Jquiery Combobox 用到的例子
最近在項目中用到的combobox的例子
從背景傳回json資料,前台組裝
<td><div id="xxx" style="display: none;"><input id="nextPerson" editable="false" class="easyui-combobox" style="width: 130px;" name="xxxx.xxxxx"
data-options="required:true,
url:'<%=path%>/ModelManager/getJsonUsers.html?role.roleCode=<ww:property value='@[email protected]'/>',
valueField:'userId',
textField:'fullName',
panelHeight:'auto',
width:90,
onLoadSuccess:function(){
$('#nextPerson').combobox('setValue',-1);//設定預設選中項
}
"/></td>
這裡從getJsonUsers.html這個對應的action中得到json object,然後設定value,顯示的是fullName字段。