easyui combobox 带 checkbox 亲自验证

Posted 野狼谷

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了easyui combobox 带 checkbox 亲自验证相关的知识,希望对你有一定的参考价值。

$(‘#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 亲自验证的主要内容,如果未能解决你的问题,请参考以下文章

easyui combobox完全匹配valueField的bug

easyui combobox 设置值

关于easyui combobox

easyui combobox怎么用

easyui combobox中的值是从数据库拿过来的,编辑easyui gridveiw时combobox定位gridveiw对应值

easyui-combobox