View Full Version : Dynamically change FlowLayout rows number

17 Aug 2009, 1:17 AM
I'm a new Ext GWT user, and I used the LocalPaging Grid Example.
I added a ListBox to the toolBar in the bottom, in order to chose the number of listed rows in the page.
The problem is that I don't know how to make the grid be shown dynamically when I select the new value of the rows number in the ListBox.
Could you help me please ?! :)
PS : I'm using GWT 1.6 and GXT 2.0

19 Aug 2009, 3:49 AM
i think you mean something like this (but all this are in extjs you have to adopt this to GXT - but it gives you a hint how to do it):

http://extjs.com/learn/Plugin:pPageSize (ExtJS 2.0)

[3.x] Ext.ux.grid.PageSizer

3.x] Ext.ux.grid.AutoRefresher

20 Aug 2009, 7:22 AM
Finally I ask the class which contains my Grid to destroy it and construct an onther one with the new value.
It works but I'm sure it's not the best way.

In fact, I have a stupid question :-/
why can't we add an item to an HorizontalPanel for example after removing some elements...
Here an example :

public class Test implements EntryPoint {

final HorizontalPanel hp = new HorizontalPanel();

final HorizontalPanel hp1 = new HorizontalPanel();
final HorizontalPanel hp2 = new HorizontalPanel();

final Button b = new Button("Switch");
final Button b1 = new Button("ONE");
final Button b2 = new Button("TWO");

public void onModuleLoad() {


b.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {




When I click on the button b, the button b1 disappear but the button b2 is not added to hp.
Could you help me please ? I spent more then 2 hours but I didn't find it :(

Thank you :)