Reputation: 1267
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
Upvotes: 0
Views: 497
Reputation: 3628
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);
Upvotes: 0