$('#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]
},
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 name选择器
- easyui treegrid实现显示checkbox并能获取到选定值的
- EasyUI-datagrid中使用combobox设置默认值解决
- 实现带查询功能的ComboBox控件
- easyui treeJson 带层数
- easyui tree带checkbox实现单选
- jQuery EasyUI Combobox 无法获取属性 options 的值: 对象为 null 或未定义
- easyui datagrid combobox下拉框获取数据问题
- easyui datagrid 分页保持checkbox选中状态
- EASYUI DATAGRID 多列复选框CheckBox