【问题标题】:pre selecting checkboxes in checkboxselection model+extjs在 checkboxselection model+extjs 中预先选择复选框
【发布时间】:2012-05-07 22:15:25
【问题描述】:

我有一个带有复选框选择模型的网格。我想根据网格的数据存储预先选择复选框。谁能帮帮我?

【问题讨论】:

    标签: extjs checkbox grid


    【解决方案1】:

    可以使用 store 的 'load' 事件和 RowSelectionModel 对象的 'selectRows' 方法来选择行。

    var grid = new Ext.grid.GridPanel(...
               sm:new Ext.grid.RowSelectionModel(),..); 
    var store = new Ext.data.JsonStore(...);
    store.on('load',function(records){
         Ext.each(records,function(record){
              //here you construct an array of row numbers in the grid that you want         to select, based on the records you just loaded into the store , let the array be 'rows'
           grid.getSelectionModel.selectRows(rows); 
         }) 
    });
    

    【讨论】:

      猜你喜欢
      • 2015-03-03
      • 2023-04-01
      • 2020-10-21
      • 1970-01-01
      • 2022-01-05
      • 1970-01-01
      • 2017-10-09
      • 1970-01-01
      • 2013-08-22
      相关资源
      最近更新 更多