easyui combobox 带 checkbox 亲自验证
2017-11-14 11:10
225 查看
$('#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);
}
});
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 验证输入的值必须为选项框中的数据
- Easyui 验证验证扩展,限制combobox 只能输入选项内容
- easyui combobox 带 checkbox
- easyui中combobox 验证输入的值必须为选项框中的数据
- EasyUi combobox-checkbox 带全选功能
- EasyUI下combobox中添加checkbox,并输入全拼简拼进行筛选显示
- easyui的combobox验证图片怎么让他在新打开页面不出现
- easyui combobox 中实现 checkbox
- easyui combobox 隐藏显示,加载取消验证。
- easyui中combobox 验证输入的值必须为选项框中的数据
- easyui中combobox 验证输入的值必须为选项框中的数据
- EasyUI combobox动态设置是否验证
- 表单(上)EasyUI Form 表单、EasyUI Validatebox 验证框、EasyUI Combobox 组合框、EasyUI Combo 组合、EasyUI Combotree 组合树
- Easyui-combobox-checkbox-带复选框的下拉框
- 关于easyUI中combobox多选并附加checkbox的实现
- 关于easyUI中combobox多选并附加checkbox的实现
- easyui combobox with checkbox item
- easyui combobox 带 checkbox
- jquery.easyui添加表单验证
- CustomValidator验证CheckBoxList必须选择且只能选择一个