Hybrid View
-
30 Sep 2010 8:16 AM #1
AutoRefreshing Grid?
AutoRefreshing Grid?
Hello,
I want autorefreshing (ex. every 1 minutes) on GridPanel:
GridPanel code:
In New.Viewport I have this in items:PHP Code:var w = new Ext.grid.GridPanel({
store: store,
columns: [
{header: 'numbs', width: 100, sortable: true, dataIndex: 'name'},
{header: 'txt', width: 100, sortable: true, dataIndex: 'position'},
{header: 'dt', width: 250, sortable: true, dataIndex: 'ambition'}
],
stripeRows: true,
height:250,
width:400,
collapsible:true,
region:'west',
split: true,
title:'newnumb',
trackMouseOver: true,
autoload: true,
bbar: new Ext.PagingToolbar({
pageSize: 10, // data to display
store: store,
displayInfo: true,
displayMsg: 'Show {0} - {1} / {2}',
emptyMsg: "-"
})
});
PHP Code:w.show()
-
30 Sep 2010 8:53 AM #2
take a look at the Ext.TaskMgr class
-
30 Sep 2010 9:14 AM #3
It doesn't work. Show me example solution. I want autoreload w.show() function in viewport code:
And GridPanel is shown:Code:new Ext.Viewport({ layout: 'border', defaults: { height: 90, width: 150 }, items: [ { title: 'titletest', region: 'center', /*autoLoad: {url: 'fetchnew.php', scope: this},*/ split: true, layout: 'auto', items: [{ title: 'first', html: 'The first tab\'s content. Others may be added dynamically', border: true, split: true, collapsible: true }, { title: 'second', html: 'The first tab\'s content. Others may be added dynamically', border: true, split: true, collapsible: true } ] }, { title: 'Status', region: 'south', split: true, collapsible: true }, w.show(), { title: 'Easst', region: 'east', split: true, collapsible: true } ] });
PHP Code:var w = new Ext.grid.GridPanel({
store: store,
columns: [
{header: 'numbs', width: 100, sortable: true, dataIndex: 'name'},
{header: 'tyt', width: 100, sortable: true, dataIndex: 'position'},
{header: 'dt', width: 250, sortable: true, dataIndex: 'ambition'}
],
stripeRows: true,
height:250,
width:400,
collapsible:true,
region:'west',
split: true,
title:'Novi brojevi',
trackMouseOver: true,
autoload: true,
interval: 1000,
bbar: new Ext.PagingToolbar({
pageSize: 10, // data to display
store: store,
displayInfo: true,
displayMsg: 'Show {0} - {1} / {2}',
emptyMsg: "-"
})
});
-
30 Sep 2010 9:56 AM #4
Here try this.
Code:var west = new Ext.grid.GridPanel({ store: new Ext.data.SimpleStore({ autoDestroy: true, autoLoad: true, data: [['Bob', 'CEO', 'Good']], fields: ['name', 'position', 'ambition'] }), columns: [ {header: 'numbs', width: 100, sortable: true, dataIndex: 'name'}, {header: 'tyt', width: 100, sortable: true, dataIndex: 'position'}, {header: 'dt', width: 250, sortable: true, dataIndex: 'ambition'} ], stripeRows: true, margins: '0 0 0 0', height:250, width:400, collapsible:true, region:'west', split: true, title:'Novi brojevi' }); Ext.onReady(function(){ var vp = new Ext.Viewport({ layout: 'border', items: [{ title: 'titletest', region: 'center', /*autoLoad: {url: 'fetchnew.php', scope: this},*/ margins: '0 0 0 0', layout: 'fit', items: [] }, west] }); var task = { run: function(){ // Reload the grid's store //west.store.reload(); // Refresh the grid's view west.getView().refresh(); console.log("I just refreshed the Grid View"); }, interval: 5000 // Every 5 seconds the grid's view will refresh. } Ext.TaskMgr.start(task); });
Similar Threads
-
AutoRefreshing JSonViews
By javajunky in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 20 Jun 2007, 7:55 AM


Reply With Quote