2
我有一个复选框选择模型的网格。我想预先选择基于网格数据存储的复选框。任何人都可以请帮我吗?预先选中复选框选择模型中的复选框+ extjs
我有一个复选框选择模型的网格。我想预先选择基于网格数据存储的复选框。任何人都可以请帮我吗?预先选中复选框选择模型中的复选框+ extjs
可以使用商店的'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);
})
});