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

      

  • 相关阅读:
    软件工程课感想
    冲刺阶段(二)第五天 5月19日
    CATransition转场动画
    UIView与CALayer的区别
    CALayer的基本属性
    CALayer的基本属性和contexts的内容 即添加图片
    Quartz2D-master手动截图
    CoreAnimation-06-CAKeyframeAnimation 相关代码
    CoreAnimation-06-CAKeyframeAnimation
    视频播放
  • 原文地址:https://www.cnblogs.com/yubinfeng/p/4463418.html
Copyright © 2011-2022 走看看