PDA

View Full Version : Catching removed records in EditorGridPanel



dreamcaster
29 Sep 2009, 6:54 PM
Hello experts,

Would like to ask if it is possible for me to retrieve the records that was removed in the EditorGridPanel using remove() method. What I need to do is get all the changes in a certain EditorGridPanel. Using getModifiedRecords() I can get all the modified records.

Thanks!

BitPoet
29 Sep 2009, 8:30 PM
Just hook onto the store's 'remove' event and cache them whereever appropriate, e.g.:


new Ext.data.Store({
...your store config...
,removedRecords: [],
,listeners: {
remove: function(store, rec, idx) {
store.removedRecords.push( rec );
}
}
,clearRemoved: function() {
this.removedRecords = [];
}
});

dreamcaster
29 Sep 2009, 8:39 PM
Thanks! Really a great help. :-)