input combobox 设置多个选中的值

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yongjiutongmi53151/article/details/87857057

 $('#depID').combobox('setValue', json);最后这个json就是一个json格式的字符串,直接放进去就会默认选中json中的数据

<input class="easyui-combobox" id="depID" name="depID" style="width:100%" 
                        data-options="
                            url:'/department/combobox',
                            valueField:'id',
                            textField:'depName',
                            multiple:true,
                            panelHeight:'auto',
                            label: '部门:',
                            onLoadSuccess: function(data){
                                if(json !=''){
                                    for(var p in json){
                                        $('#depID').combobox('setValue', json);
                                    }
                                }
                            }
                            ">

猜你喜欢

转载自blog.csdn.net/yongjiutongmi53151/article/details/87857057