easyui combobox with checkbox item
2017-05-11 09:34
204 查看
$('#cc').combobox({ url:'combobox_data1.json', method:'get', valueField:'id', textField:'text', panelHeight:'auto', multiple:true, formatter: function (row) { var opts = $(this).combobox('options'); return '<input type="checkbox" class="combobox-checkbox">' + row[opts.textField] }, onShowPanel: function () { var opts = $(this).combobox('options'); var target = this; var values = $(target).combobox('getValues'); $.map(values, function (value) { var el = opts.finder.getEl(target, value); el.find('input.combobox-checkbox')._propAttr('checked', true); }) }, onLoadSuccess: function () { var opts = $(this).combobox('options'); var target = this; var values = $(target).combobox('getValues'); $.map(values, function (value) { var el = opts.finder.getEl(target, value); el.find('input.combobox-checkbox')._propAttr('checked', true); }) }, onSelect: function (row) { //console.log(row); var opts = $(this).combobox('options'); var el = opts.finder.getEl(this, row[opts.valueField]); el.find('input.combobox-checkbox')._propAttr('checked', true); }, onUnselect: function (row) { var opts = $(this).combobox('options'); var el = opts.finder.getEl(this, row[opts.valueField]); el.find('input.combobox-checkbox')._propAttr('checked', false); } });
相关文章推荐
- EasyUi combobox-checkbox 带全选功能
- Combobox的IsSynchronizedWithCurrentItem 属性
- 14. 11. 5. Listening to JCheckBox Events with an ItemListener
- easyui combobox 带 checkbox
- 关于easyUI中combobox多选并附加checkbox的实现
- easyui combobox 带 checkbox
- 关于easyUI中combobox多选并附加checkbox的实现
- Easyui-combobox-checkbox-带复选框的下拉框
- EasyUI下combobox中添加checkbox,并输入全拼简拼进行筛选显示
- easyui combobox 带 checkbox 亲自验证
- easyui combobox 中实现 checkbox
- easyui combobox加载内嵌对象赋值
- WPF的Combobox的ItemSource第二次绑定(更新)问题
- Easyui笔记3:实现combobox下拉框高度自适应
- easyui-datagrid-combobox
- EasyUI Combobox 二级联动
- easyui combobox 加载数据默认选中
- easyui的combobox控件,在火狐浏览器下,使用getValue()方法无法获取输入的中文数值的解决思路
- etmvc+jQuery EasyUI combobox实现google提示
- listview/gridview上checkbox和button以及item获取焦点的问题