PDA

View Full Version : Grid Datasource



gibffe
20 Sep 2007, 2:44 AM
Hi all

I'm new to extjs, doing some experiments at the moment.
I have a Grid with a paging toolbar and a datasource reading remote json data
connected to it.

What is the easiest way to change the datasource in the grid so that the paging
toolbar picks it up ?

I tried grid.reconfigure, the data changed but the paging toolbar
aparently didn't spot the change - so i invoked bind(new data source) on the toolbar
it seemed to work. But... is there any easy way to get hold of this toolbar object having
only grid ? Currently I save a reference to the toolbar, but maybe I can dig to it starting
from the grid object ?

Lucas

Animal
20 Sep 2007, 2:49 AM
No, you must keep a reference to it. The GridView has a getFooterPanel() but that just returns a Element into which you render a PagingToolbar, so it's up to you to keep track of a reference to it.

Animal
20 Sep 2007, 2:50 AM
Of course you can just poke a reference into the Grid.



myGrid.pagingToolbar = new Ext.PagingToolbar(...

gibffe
20 Sep 2007, 3:23 AM
This approach seems to be what I need really.
Thanks :)

Lucas