PDA

View Full Version : Extjs 3.3 response after automatic store reload



jorgeluislay
11 Jul 2012, 7:19 AM
Hi!

Im trying to make a response message which shows infomation after the store has been change. How can i make a request which stays on hold till it finds changes on the store.

I thought about this solution:

1) making automatically request, but dont know how to implemente this function.

sword-it
11 Jul 2012, 7:33 AM
Hi,

I need to know where your data is manipulated. Can users edit row data using inline editing or external editing? Or row data is modified in the server side and you would like to check if there is any modification?

Regards.

jorgeluislay
11 Jul 2012, 8:12 AM
Store will be modified on server side so i need to check if there ist new modifications. if there is some, i want them to show, if not, it should check every 2 minutes or 5 (whatever) or it should check every 5 sec.

jorgeluislay
12 Jul 2012, 12:01 PM
anybody any idea how can i implement a this function ?

if (changesInStoreFromServer == true ){

showMassage("New custom message for you" + messageFromStore);

else do nothing;

how can i do this ?

is there any timer function i can implement ?

dracofyre
13 Jul 2012, 11:09 AM
You could start a Task that on interval makes a request to the server to determine if the store on the server has been modified. Take a look athttp://docs.sencha.com/ext-js/3-4/#!/api/Ext.TaskMgr for an example.

Semi-Pseudo Code:


var task = {
run: function(){
Ext.sendRequest ({success: function(){
if(modifications == true){
//Show special dialog;
Call Ext.TaskMgr.stop(this);
}
}});
},
interval: 30000 //30 seconds
};


Ext.TaskMgr.start(task);

jorgeluislay
16 Jul 2012, 7:19 AM
Thank you, exactly what i need.