【问题标题】:CheckboxModel to get checked All value in extjsCheckboxModel 来检查 extjs 中的所有值
【发布时间】:2014-09-04 08:41:41
【问题描述】:

我在网格面板中使用了复选框模型,它可以全部选中。我在选中或未选中选定列时得到了值。像这样

var selModel = Ext.create('Ext.selection.CheckboxModel', {
    checkOnly: true,
    listeners: {
        deselect: function(model, record, index) {
            id = record.get('id');
            alert(id);
        },
        select: function(model, record, index) {
            id = record.get('id');
            alert(id);
        }
    }
})

但是当我点击全部选中时如何获得价值?

【问题讨论】:

    标签: javascript extjs


    【解决方案1】:

    使用selectionchange 事件:

    在选择更改发生后触发

    参数:

    这个:Ext.selection.Model
    已选择:Ext.data.Model[] 已选择记录
    eOpts: Object 传递给Ext.util.Observable.addListener的选项对象。

    您也可以在select 事件中使用getSelection() 方法:

    返回当前选中记录的数组。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-17
      • 1970-01-01
      相关资源
      最近更新 更多