PDA

View Full Version : How to clone a store



tdikarim
29 Sep 2011, 12:19 AM
Hi,

I have a store that is configured by metadata.

I want to move in another store all the row that the user have deleted.
The goal is to have an "undo delete" and display all the deleted row in another grid

Thanks for your help

Madhu11
29 Sep 2011, 8:46 AM
See whether this solves part of your problem
// copying 'store1' data to 'store2' var records = []; store.each(function(r){ records.push(r.copy()); }); var store2 = new Ext.data.Store({ recordType: store1.recordType }); store2.add(records);

Madhu11
29 Sep 2011, 8:51 AM
despite my best effort I could not format it :(

tdikarim
29 Sep 2011, 11:04 PM
See whether this solves part of your problem


// copying 'store1' data to 'store2'
var records = [];
store.each(function(r){
records.push(r.copy());
});
var store2 = new Ext.data.Store({
recordType: store1.recordType
});
store2.add(records);



Thanks
I wil try that ...

Madhu11
16 Jan 2012, 7:03 AM
Did it help?