PDA

View Full Version : DataStore, proxy and events (succes...)



sekaijin
5 Dec 2011, 7:55 AM
Good morning.
I'm use MVC pattern

With the Data Package Ext4 I can not find how to be informed of the success or failure of a sync my data store ?
ex:

remove : function(cfg) {
this.getAppsStore().on('remove', cfg.callback, cfg.scope);
var store = this.getAppsStore();
store.remove(store.getById(cfg.id));//this send the "remove" event
console.log('removed from the DataStore but not destroyed on server');
this.getAppsStore().sync();
//destroyed on server
},

I want to call "Calback" on "sucess" event of destroy action on the proxy, not the "remove" event of the DataStore.

but in the doc are no events on Oppers Proxy

A+JYT
PS: sorry for my approximative english

mitchellsimoens
5 Dec 2011, 8:29 AM
The Store only has a remove event, the proxy doesn't. Why can't you use the remove event on the Store?

sekaijin
5 Dec 2011, 9:23 AM
I have a tree that contains many types of data

Root
Applications
app_1
app_2
...
Users
user_1
...
Ressources
res_1
...
Etc.
So the controller for this tree can not be a Controller.Apps or a Controller.Users or ..
I have a controller specifically for this purpose.

when data changes in the data store (ex: store.Apps or store.Users) , it has not yet changed on the server. I can not update the node of the tree.
I'm sure when the event "success" comes.

Bye