This article mainly introduced the Easyui ComboBox default value notice, is the individual in the project meets and solves the matter, shares to everybody, needs the friend to be possible to refer to under
When you modify data, you need to load the data first.
When loading ComboBox data, the data from the background should be int type.
HTML code
The code is as follows:
<tr>
<TD style= "text-align:right;" > Department:</td>
<input type= "hidden" id= "Belongsvalue" value= "${fbook.belongs}"/>
<!--must be data for int, otherwise automatically select--> in dropdown box
<td>
<input name= "belongs" id= "belongs" ></input>
</td>
</tr>
JavaScript code
The code is as follows:
$ (' #belongs '). ComboBox ({
URL: ' Opr/book/combobox.do ',
Valuefield: ' id ',
TextField: ' Name ',
Width: ' 140 ',
Height: ' 29 ',
Editable:false,
Panelheight: ' Auto ',
Onloadsuccess:function (data) {
var B1 = $ (' #belongsvalue '). Val (); B1 is an int type of data
$ (' #belongs '). ComboBox (' SetValue ', B1);
}
});
The above is the entire content of this article, I hope that we can help.