samedi 17 janvier 2015

Load store function

Hi,

When i load a store from a server with proxy, i test on the server if the user have the right to do that or if he is connected (with session). In this case i not return the data but a message. I would test the data returned by the server to display the message.

The server return something like that :



Code:



{"success": false, "response" : { "success": "false", "msg": "The message"}}

There are parameters for the load function : records, operation, success. I think operation can be used, but i don't know how.


Code:



store.load( function(records, operation, success){
if(success){
// ok
console.log('ok:' + records.length);

} else {
// I would display my message and do something, but where is my message !
}
});

Some one could help me ?

Sorry for my english and my lack knowledge...


Thank you by advance


Best regards

LaZag






Load store function

Aucun commentaire:

Enregistrer un commentaire