$.post("getSubInsuranceTypeList.do",{parent_id:node.id},function(result){
if (result.length == 0){
$("#sub-insurance").addClass("none");
} else {
$("#sub-insurance").removeClass("none");
// 带复选框的下拉框
$("#sub_insurance_type").combobox({
data:result,
multiple:true,
valueField: \'id\',
textField: \'text\',
panelHeight: \'auto\',
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) {
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);
}
});
}
},"json");
相关文章:
- EASYUI DATAGRID 多列复选框CheckBox 2021-06-25
- easyui的combobox带checkbox的全选功能 2021-05-19
- easyui combo下拉框多选框 2022-12-23
- c#多选下拉框(ComboBox) 2022-12-23
- jQuery模拟下拉框单选框复选Select,Checkbox,Radio 2021-09-27
- easyui combobox下拉框调整高度 2022-12-23
- 复选框、下拉框 2021-11-09