-
21 May 2010 2:19 AM #1
How to refresh a gridPanel?
How to refresh a gridPanel?
Hi,
I have a gridPanel that contains data from a database.
I have a fonction to add data in the database and it work but now i'd like to refresh my gridPanel to see the new data.
I tried to re-call the function that display the grid but it display the same grid under the first one...
Romain.
-
21 May 2010 2:58 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
Code:grid.getStore().reload();
-
21 May 2010 3:14 AM #3
It does not work with my grid, i don't use proxy, i take my data from the data base with java class uning DWR.
But i found a solution, i put a var gripGlobal as a global var so i can access it anywhere. Then i juste have to hide the gridGlobal and reDisplay it.
Thank you !
-
21 May 2010 3:22 AM #4
That won't reload the data! It hides and shows a DOM element. Completely pointless.
If you have written your code correctly to use a DWRProxy, then simply grid.getStore().reload() will work.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
28 May 2010 9:35 PM #5
How to refresh the grid panel if its loaded from a function not using proxy?
How to refresh the grid panel if its loaded from a function not using proxy?
Hello Animal.. I'm a newbie in ExtJS. I am loading the grid panel using a function, not using a url. The function gets the data for me from the database. In this case, how to refresh the grid panel?
-
28 May 2010 10:33 PM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
Putting both the code and the data in a single page makes it impossible to do that.
Rewrite your server app to return the data on a separate url and change the store to load from that page.
After you having done this you can simply reload() the store.
-
30 May 2010 10:37 PM #7
-
17 Jun 2010 3:10 AM #8
One more question about this:
One more question about this:
Hi dudes, I have following stuff:
In another place a have a tree, I want to change data in proc_grid likethis:Code://process information var proc_dataReader = new Ext.data.ArrayReader({}, [{ name: 'INSERTEDDATE', type: 'date', dateFormat: 'Y-m-d H:i:s' }, { name: 'MESSAGEKEY' }, { name: 'ESBCONTAINER' }, { name: 'ESBPROCESSNAME' }, { name: 'ESBPROCESSSTEP' }, { name: 'LOGLEVEL' }]); var proc_someData = [ ["2004-12-01 11:12:13", "Stopped", "Container1", "1231243", "First Step", "DEBUG"], ["2004-12-01 11:12:13", "Stopped", "Container1", "1231243", "First Step", "INFO"], ["2004-12-01 11:12:13", "Stopped", "Container1", "1231243", "First Step", "ERROR"] ]; var proc_ds = new Ext.data.Store({ proxy: new Ext.data.PagingMemoryProxy(proc_someData), remoteSort: true, reader: proc_dataReader }); var proc_cm = new Ext.grid.ColumnModel([{ dataIndex: 'INSERTEDDATE', header: 'Date', width: 60, renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s') }, { dataIndex: 'MESSAGEKEY', width: 50, header: 'Status' }, { dataIndex: 'ESBCONTAINER', header: 'Container' }, { dataIndex: 'ESBPROCESSNAME', header: 'Process' }, { dataIndex: 'ESBPROCESSSTEP', header: 'Step' }, { dataIndex: 'LOGLEVEL', header: 'Log Level' }]); proc_cm.defaultSortable = true; var proc_grid = new Ext.grid.GridPanel({ id: 'act_example', ds: proc_ds, cm: proc_cm, height: 200, enableColLock: false, loadMask: true, viewConfig: { forceFit: true }, plugins: act_filters, listeners:{ activate: function(){ proc_ds.reload(); } }, bbar: new Ext.PagingToolbar({ store: proc_ds, pageSize: 15, plugins: act_filters }) }); proc_ds.load({ params: { start: 0, limit: 15 } });
I have an alert on click, but nothing changes, my data is still the same. What am I doing wrong?Code:click: function(n) { //Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' + n.attributes.processid + '"'); proc_someData = [ ["2004-12-01 11:12:13", "AAAA", "Container1", "1231243", "First Step", "DEBUG"], ["2004-12-01 11:12:13", "AAAAAAAA", "Container1", "1231243", "First Step", "INFO"], ["2004-12-01 11:12:13", "BBBBBB", "Container1", "1231243", "First Step", "ERROR"] ]; proc_ds.reload(); proc_grid.getStore().reload(); }
The problem is I can not get the data directly from URL, so I have to do some operations with it to put good objects in my grid.
Similar Threads
-
Auto Refresh GridPanel?
By ferryman in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 9 Aug 2009, 10:59 PM -
Doubts about GridPanel: sort and refresh
By Gorka Lopez in forum Ext 2.x: Help & DiscussionReplies: 5Last Post: 26 Feb 2009, 11:40 PM -
How to refresh GridPanel
By silcreval in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 29 Dec 2008, 5:11 AM -
GridPanel sorting problem after refresh
By epiceric in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 5 Sep 2008, 2:59 PM -
GridPanel won't refresh on GroupingStore reload
By Luke Hammond in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 12 Jun 2008, 11:15 AM


Reply With Quote
Your suggestion worked for me