zoukankan      html  css  js  c++  java
  • 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");

  • 相关阅读:
    CSS水平居中和垂直居中解决方案
    MVC 发布到IIS中的配置方法
    iis配置asp.net常见验证失败问题解决方案
    fiddler无法抓取chrome解决方法
    VBA取得EXCEL表格中的行数和列数
    Oracle VM VirtualBox做好虚拟硬盘后,如何进一步修改虚拟硬盘的大小
    SQL Server 2008用'sa'登录失败,启用'sa'登录的办法
    unity3d中物体的控制
    GameObject数组
    Linux进程与线程概述
  • 原文地址:https://www.cnblogs.com/zisezhixin/p/5069858.html
Copyright © 2011-2022 走看看