2012-06-18 23 views
0

我正在使用jQuery容易的UI crud數據網格,並且需要組合框之一的列。我有組合框填充,但現在我需要能夠過濾框,如果一個項目需要改變。在Datagrid中過濾jeasyui組合框並顯示文本而不是值

我的問題的第2部分是,我一直無法設置組合中的值從id到框中的實際文本eg。 ID是15488這是林肯公園。我想讓它顯示林肯公園,而不是ID

組合框的源數據是一個PHP腳本選擇所有藝術家並把它在一個數組,然後將其編碼爲JSON

繼承人我的代碼爲DataGrid

<table id="dg" title="Tracklisting" style="width:1000px;height:250px" 
     toolbar="#toolbar" pagination="true" 
     rownumbers="true" singleSelect="true"> 
    <thead> 
     <tr> 
      <th field="TRACK NO" width="50" editor="{type:'validatebox',options:{required:true}}">ID</th> 
      <th field="DISC NO" width="50" editor="{type:'validatebox',options:{required:true}}">CAT No</th> 
      <th field="TRACKTITLE" width="50" editor="{type:'validatebox',options:{required:true}}">Track No</th> 
      <th field="VERSION" width="50" editor="text">Title</th> 
      <th field="ARTIST_ID_1" width="100" editor="{type:'combobox',options: 
{valueField:'ID',textField:'ARTIST',url:'get_artist.php',required:true}}">Artist</th> 
     </tr> 
    </thead> 
</table> 
+0

您的組合代碼看起來正確的給我(我還在學習jeasyui東西雖然)這可能是與你的PHP文件中的一個問題? – FireCrakcer37

回答

0

回答你的第二個問題:

formatter="JS_function"

使用這個JavaScript函數的將調用n來顯示網格中選定值的文本。 請詳細解釋第一個問題。

相關問題