我正在使用jquery easy ui crud datagrid,并且需要其中一列的组合框。我已经填充了组合框,但现在我需要能够在需要更改项目时过滤该框。
我问题的第 2 部分是我无法将组合中的值从 id 设置为框中的实际文本,例如。ID是15488,是林肯公园。我希望它显示林肯公园,而不是ID
组合框的源数据是一个 php 脚本,选择所有艺术家并将其放入数组中,然后将其编码为 json
这是我的数据网格代码
<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>
回答你的第二个问题:
formatter="JS_function"
将调用此 javascript 函数来显示网格中所选值的文本。请详细解释第一个问题。