码迷,mamicode.com
首页 > 其他好文 > 详细

easyui combobox 带 checkbox 亲自验证

时间:2017-11-14 14:12:04      阅读:657      评论:0      收藏:0      [点我收藏+]

标签:ext   uefi   efi   var   checkbox   target   tar   pat   input   

$(‘#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 带 checkbox 亲自验证

标签:ext   uefi   efi   var   checkbox   target   tar   pat   input   

原文地址:http://www.cnblogs.com/yelanggu/p/7831502.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!