在checkboxselection模型+extjs中预先选择复选框

在checkboxselection模型+extjs中预先选择复选框,extjs,checkbox,grid,Extjs,Checkbox,Grid,我有一个带有复选框选择模型的网格。我想根据网格的数据存储预先选择复选框。有人能帮我吗?可以使用存储的“加载”事件和RowSelectionModel对象的“选择行”方法来选择行 var grid = new Ext.grid.GridPanel(... sm:new Ext.grid.RowSelectionModel(),..); var store = new Ext.data.JsonStore(...); store.on('load',function(reco

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

可以使用存储的“加载”事件和RowSelectionModel对象的“选择行”方法来选择行

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); 
     }) 
});

可以使用存储区的“加载”事件和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); 
     }) 
});