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');
}
}
});
 
                     
                    
                 
                    
                
 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号