yubinfeng
$(\'#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]
                },

                onShowPanel: 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);
                    })
                },
                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);
                }
            });

  

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2022-01-23
相关资源
相似解决方案