-
3 Apr 2008 10:48 AM #1
Grid Auto Refresh
Grid Auto Refresh
Im having issues locating a good resource, to make my grid auto refresh every 20 - 25 seconds. Does anyone have any good ideas pretaining to that issue?
Thanks
-
3 Apr 2008 10:52 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
You can use task manager to fire off a datastore reload. be aware that if a user has scrolled to a specific point, they get rolled back to zer0

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
3 Apr 2008 11:23 AM #3
The grid has paging on it, and the paging is set to 20 right now, is there a simple way to get the grid to auto refresh every 20 - 25 seconds all the time to make sure its up to date?
-
3 Apr 2008 11:27 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
3 Apr 2008 11:51 AM #5
ok i was playing with that a little, i got it to not throw any errors but it doesnt appear to be updating
refresh script
Grid its RefreshingCode:var mainquoterefresh = { run: function(){ loadMask: true, mainquoteStore }, interval: 10000 //1 second } Ext.TaskMgr.start(mainquoterefresh);
Am i doint this wrong?Code:var mainquoteStore = new Ext.data.Store({ storeId: 'mainquotes', proxy: new Ext.data.HttpProxy({url:'php/JSONMQ.php'}), reader: new Ext.data.JsonReader({ root: 'quotesmain', remoteSort: true, totalProperty: 'totalCount' }, [ {name: 'select', type: 'float'}, {name: 'quote', type: 'string' , mapping: 'quote'}, {name: 'fname', type: 'string' , mapping: 'fname'}, {name: 'lname', type: 'string' , mapping: 'lname'}, {name: 'phonenum', type: 'string' , mapping: 'phonenum'}, {name: 'email', type: 'string' , mapping: 'email'}, {name: 'timerecieved', type: 'date', dateFormat: 'Y-m-d h:i:s a' , mapping: 'timerecieved'}, {name: 'customertype', type: 'string' , mapping: 'customertype'}, {name: 'websitesubmit', type: 'string' , mapping: 'websitesubmit'}, {name: 'delquote', type: 'float'} ] ) }); mainquoteStore.setDefaultSort('quote', 'ASC');
-
3 Apr 2008 12:45 PM #6
theres a few extension that have been written for this as well.
-
3 Apr 2008 12:47 PM #7Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
your function declaration is completely incorrect.
try:
PHP Code:var mainquoterefresh = {
run: function(){
mainquoteStore.load();
},
interval: 10000 //1 second
}
Ext.TaskMgr.start(mainquoterefresh);

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
9 Jun 2010 5:50 AM #8
A TaskRunner [Ext.util.TaskRunner()] can be a good alternative to auto refresh a Grid. Derived from Class Ext.util; Class Ext.util.TaskRunner - Provides the ability to execute one or more arbitrary tasks in a multithreaded manner. Generally, you can use the singleton Ext.TaskMgr instead, but if needed, you can create separate instances of TaskRunner.
Code:var task = { run: function() { mainquoteStore.load() // mainquoteStore is a variable... var mainquoteStore=new Ext.data.Store(); }, interval: 10000 //10 second } var runner = new Ext.util.TaskRunner(); runner.start(task);~::Chetan Akarte::~
http://www.tipsntracks.com




Reply With Quote