当前端使用到easyui-combobox需要执行修改方法想返回原来的初始值时,需要使用到combobox中的onLoadSuccess
,如果只是添加的话则不需要。
onLoadSuccess: function (){
$("#cc").combobox('select',修改时赋值);
}
具体如此下:
jsp:
<div>
<label>一级分类名称:</label>
<select id="cc" class="easyui-combobox" name="parentId" required="true" style="width:150px;"></select>
</div>
js:
$("#cc").combobox({
editable : true,
url : proPath+"/category/all?isParentId=1",//url,
valueField : "id", //相当于 option 中的 value 发送到后台的
textField : "name",//option中间的内容 显示给用户看的
onLoadSuccess: function (){
$("#cc").combobox('select',row.parentId);
}
});