PDA

View Full Version : storeIng.load({url: "blabla.jsno"});



rans
25 Oct 2012, 6:10 AM
Hi, how do I know if the this commend was successful or not?
storeIng.load({url: "blabla.jsno"});

thanks
rans

skirtle
25 Oct 2012, 7:34 AM
See the docs here:

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Store-method-load

Note the third argument passed to the callback is success.

James Goddard
25 Oct 2012, 11:35 AM
It's a matter of personal preference but I would use:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Store-event-load

as that would cover autoLoad as well.

skirtle
25 Oct 2012, 12:20 PM
Good point, I probably should have mentioned the load event in my original reply. It is a viable alternative to the callback but I'm not sure I'd call it 'a matter of personal preference'. That implies that they're effectively interchangeable but in many cases there's only one that will give the desired results. Difficult to say which from the OP's question.

In most of my apps I don't bother detecting load errors on individual stores, I just have a catch-all error handler on Ext.Ajax instead. It depends what the errors signify and how you want to handle them.

rans
28 Oct 2012, 7:05 AM
it's works!!
the problem was that I wrote the "success" function and didn't let the program building it