2012-01-27 64 views

回答

0

可以使用商店的'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); 
    }) 
});