ExtJS 2.3/3.x Grid store

495 Views Asked by At

I have a grid that uses a Json Store, on the grid I use a checkselectionmodel. I would like to populate another grid with the records selected from the first grid. What is the best way to go about it? I was thinking of cloning the store, doing a removeAll() and then an insert(). Or maybe I can do a filter? I am using this store in many parts of my application are all views going to be filtered? Thanks

1

There are 1 best solutions below

0
On
var grid1 = Ext.grid.GridPanel({ 
  store: store1
});
var grid2 = Ext.grid.GridPanel({
  store: store2
});

var records = [];
var selectedRecs = grid1.getSelectionModel().getSelections();
for (var i =0 ; i < selectedRecs.length; i ++) {
  records[records.length] = selectedRecs[i];
}

store2.add(records);