PDA

View Full Version : Implementing Polling



desouza.trevor
23 Sep 2010, 7:26 PM
I have a back end process thread that processes tasks and makes them available to users. There after this should appear in a users inbox (inbox is implemented as a grid). What is the best way to implement polling? Code snippet would be much appreciated.

Thanks

evant
23 Sep 2010, 7:27 PM
http://dev.sencha.com/deploy/dev/docs/?class=Ext.TaskMgr

http://dev.sencha.com/deploy/dev/examples/direct/direct.php

desouza.trevor
23 Sep 2010, 8:16 PM
Hi Evant,

Thanks for your reply, I did got the store to poll the server periodically and the data returned but the grid fails to refresh.

The lines i wrote are
var poll = {
run: function(){
store.removeAll();
store.load();
},
interval: 15000 //15 second
};

Am i missing something that needs to explicitly reload the grid?

desouza.trevor
23 Sep 2010, 9:22 PM
Hi Evan,

Just for completeness of this thread.

It works like a charm, the problem was with a char passed from the server.

The final code snippet

var poll = {
run: function(){
store.load();
},
interval: 15000
};