combobox 的onLoadSuccess執行兩次解決辦法和 取值賦值


加紅色字部分

 

jsp

<input class="easyui-combobox" id="keshi" name="keshi" value="${tPetitionReport.keshi}" />


js

整體關鍵代碼示例如下:

  

$('#keshi').combobox({
url: '/ccewis/xffy/keshiList',
valueField: 'id',
textField: 'groupName',
multiple:true,
//width:tableWidth*0.17,
editable: true,
filter: function (q, row) {
var opts = $(this).combobox("options");
return row[opts.textField].indexOf(q) > -1;//將從頭位置匹配改為任意匹配
},
onLoadSuccess: function () { //下拉框數據加載成功調用
var values = $(this).combobox('getValues').join(',');//獲取選中的值的values
$(this).combobox('setValues',values.split(',')); //http://www.verydemo.com/demo_c110_i7529.html
    },
onSelect: function (rec) {
var keshiId = encodeURIComponent(rec.id);
//$('#visibleMan').combobox('clear');
$('#visibleMan').combobox('reload', '/ccewis/xffy/userList?keshiId=' + keshiId);
},
onChange: function (newValue, oldValue) {
if (newValue == "") {
$('#visibleMan').combobox('clear').combobox('reload', '/ccewis/xffy/userList');
}
}
});


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM