Reputation: 61
I am using Extjs 4.0 , and I need a callback method for store.sync()
method? Does anyone have a solution? Thanks a lot!
Upvotes: 4
Views: 9653
Reputation: 1013
This should work starting from 4.1:
store.sync({
success: function()
{
console.log("success!!");
},
failure: function()
{
console.log("failed...");
},
callback: function()
{
console.log("calling callback");
},
scope: this
});
Upvotes: 8
Reputation: 559
you can catch the result of each method in your store with
Ext.define('AM.store.AdreessStore', {
extend:'Ext.data.Store',
....
onCreateRecords:function (records, operation, success) {
},
onUpdateRecords:function (records, operation, success) {
},
onDestroyRecords:function (records, operation, success) {
}
...
}
Upvotes: 1
Reputation: 645
Short question, short answer:
Try listening to the different events of store, like datachange
, update
or load
. Maybe one of them (or a combination of them) fires when you need them.
Upvotes: 0