Im having the below store and modal for a grid in extjs 4.2.
Ext.define('myapp.store.myStore',{
extends:'Ext.data.Store',
modal:'myapp.modal.myModal',
storeId:'myGridStore',
data:[],//used this only when trying inline data
proxy: {
type:'memory',
reader:{
type:'json',
}
}
});
Ext.define('myapp.modal.myModal',{
extends:'Ext.data.Modal',
fields:['bla','blha']
});
The mapping to the grid,store and modal looks fine and data is populated properly loaded in the grid.
The problem is when there are modifications to the store like
grid.getStore().removeAt(rowIndex)
or
grid.getStore().add(record)
im not able to get those through the
getRemovedRecords()
and
getNewRecords()
when i load the data into the store with the
grid.getStore().loadData(ajaxCallResponse).
It works fine when i give the data inline.
Pls help me understand what im doing wrong...
try store.getModifiedRecords() instead. This will get you the new and edited records. To check if its a new record just check the records "phantom" property which will equal true.
also, if getNewRecords() and getRemovedRecords() arent returning any records, try store.sync() after a record has been added/deleted.