When modifying data, you need to load the data first.
When loading combobox data, data of the type of int coming from the background is uploaded.
html code
The code copy is as follows:
<tr>
<td style="text-align: right;">Department:</td>
<input type="hidden" id="belongsvalue" value="${fbook.belongs}" />
<!-- Must be int data, otherwise it will be automatically selected in the drop-down box-->
<td>
<input name="belongs" id="belongs"></input>
</td>
</tr>
javascript code
The code copy 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 data of type int
$('#belongs').combobox('setValue', b1);
}
});
The above is all about this article, I hope it will be helpful to everyone.