• Easyui-combobox-checkbox-带复选框的下拉框


    $.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");

  • 相关阅读:
    洛谷 P2515 [HAOI2010]软件安装
    洛谷 P3818 小A和uim之大逃离 II
    洛谷 P3155 [CQOI2009]叶子的染色
    洛谷 P1414 又是毕业季II
    NOI 2014 起床困难综合征
    NOI 2001 反正切函数的应用
    CF1311E Construct the Binary Tree
    小技巧—卡格式
    CF817F MEX Queries
    洛谷 U138573 序章&第一章 黑暗时代(eviltime)
  • 原文地址:https://www.cnblogs.com/zisezhixin/p/5069858.html
Copyright © 2020-2023  润新知