PDA

View Full Version : callback option for store.save()



dllchrist
6 Dec 2011, 2:12 PM
Is there any way to specify callback option for store.save() method?
I tried the following but it doesn't work.



myGrid.store.save({
success : function(s, op){
console.log("save success");
}
});



btw: Where is the document for store.save(), the method is working but i can't find it in the api document.

flanders
7 Dec 2011, 2:12 AM
From the source of AbstractStore



//deprecated, will be removed in 5.0
save: function() {
return this.sync.apply(this, arguments);
},

dllchrist
7 Dec 2011, 9:42 AM
Thanks, Looks like they are replacing store.save() with store.sync(), i tried it in my code and it worked as well. Now the question is how to setup the callback option for store.sync(). I searched forum and found a couple of duplicate questions.

flanders
7 Dec 2011, 9:53 AM
Currently there is no way. It is however promised for 4.1

For now, you can use the 'load' event on the store