PDA

View Full Version : Refreshing the page when data changes at background



bee
6 Dec 2011, 4:31 AM
Hi I want to refresh the page when data changed in the back ground. I am using datachanged event of store nd calling setInterval method to load my store of 5 sec interval. It doesn't work.Please let me know how to refresh the page when data changes at background.

tobiu
6 Dec 2011, 5:04 AM
you can use a task runner:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.util.TaskRunner

or ext.direct with a polling provider:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.direct.PollingProvider

you need to bind the store to a view control in able to refresh your grid, dataview, tree or whatever.

bee
6 Dec 2011, 7:35 AM
you can use a task runner:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.util.TaskRunner

or ext.direct with a polling provider:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.direct.PollingProvider

you need to bind the store to a view control in able to refresh your grid, dataview, tree or whatever.

Thanks Tobiu,
I was using TaskRunner to refresh my page . But I dont want that way. I never used pollingprovider. need to check, by the way , can I bind my store to xtemplate ? basically I have xtemplate where I have my data there.

tobiu
7 Dec 2011, 4:16 PM
you can refresh the data of an container with:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.AbstractComponent-cfg-tpl

and

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.AbstractComponent-method-update