Reconfiguring PagingToolBar

1 view
Skip to first unread message

Alex

unread,
Feb 22, 2008, 1:12:46 PM2/22/08
to GWT-Ext Developer Forum
Hi all,


does anyone know how to reset the Store associated to a
PagingToolbar?, I mean, something similar to the reconfigure method of
GridPanel class. I tried binding again the store and even setting it
again, but there is no paging effect. I want to set the store in the
pagingToolbar when a button is pressed, is there any way to do that?

Many thanks and kind regards.
Alex.

Sanjiv Jivan

unread,
Feb 24, 2008, 10:29:03 AM2/24/08
to gwt...@googlegroups.com
Did you try

PagingToolbar.unbind(Store store) and
PagingToolbar.bind(Store store)

Please let you know what you're trying to accomplish by reconfiguring the Store associated with the PagingToolbar and post the relevant code.

Sanjiv

Alex

unread,
Feb 25, 2008, 2:55:57 AM2/25/08
to GWT-Ext Developer Forum
Hi Sanjiv,

yeah I did. My grid is fed up not at the time of rendering the grid
(the first time it should appear empty) but at the time to press a
button (the data is the result of a query). The question is that you
can't do this: grid.setBottomToolbar(pagingToolbar); after the grid is
rendered. So, I have to set the pageToolBar at the beginning, and try
to change the store when the data is loaded (after pressing the
button). So, I configure all the settings of the grid in the
constructor of the class, and the data is loaded when the onClick
event of the button fires. At this moment, i try to do this:

// At this time I have all the data to compose the URL with
all the parameters (by the time of rendering the grid I don't have all
of them)
this.dataProxy = new HttpProxy(URL);

this.pagingToolbar.unbind(store);

this.store = new Store(this.dataProxy,this.jSonReader);

this.pagingToolbar.bind(store);

this.pagingToolbar.setPageSize(10);
this.pagingToolbar.setDisplayInfo(true);
this.pagingToolbar.setDisplayMsg("Displaying companies {0} -
{1} of {2}");
this.pagingToolbar.setEmptyMsg("No records to display");

grid.reconfigure(this.store,this.columnModel);

store.load(0, 10);

I tried also to reset the store (this.pagingToolbar.setStore(store),
after constructing the new store).

Many thanks and regards.
Alex.

On 24 feb, 16:29, "Sanjiv Jivan" <sanjiv.ji...@gmail.com> wrote:
> Did you try
>
> PagingToolbar.unbind(Store store) and
> PagingToolbar.bind(Store store)
>
> Please let you know what you're trying to accomplish by reconfiguring the
> Store associated with the PagingToolbar and post the relevant code.
>
> Sanjiv
>

Alex

unread,
Feb 25, 2008, 3:04:00 AM2/25/08
to GWT-Ext Developer Forum
I forgot to say that, when I try the "unbind/bind" option I get a
javascript error "'null' is null or is not an object"

Regards.
Alex.
Reply all
Reply to author
Forward
0 new messages