Yukideluxe
22 May 2009, 12:37 AM
- Detailed description of the problem:
I've have a grid in a Window and before I show the window I update the grid's store. The first time all it's okey and the grid renders fine, but if I close and open the window again the grid renders weird (the autoexpandcolumn it's not expanded for example) It didn't happen with 1.2
- GXT version: 2.0.1
- Host mode / web mode / both: Both
- Browser and version: IE7, Firefox 3.0
- Operating System: Windows
- Sample code:
public class Test implements EntryPoint {
private Window window;
private ListStore<Stock> store;
public void onModuleLoad() {
window = new Window();
window.setSize(500, 500);
window.setLayout(new FitLayout());
window.setMinimizable(true);
window.setMaximizable(true);
gridExample();
Button b = new Button("Click", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
addStock();
window.show();
}
});
RootPanel.get().add(b);
}
public void gridExample() {
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Company");
column.setWidth(200);
configs.add(column);
column = new ColumnConfig();
column.setId("symbol");
column.setHeader("Symbol");
column.setWidth(100);
configs.add(column);
store = new ListStore<Stock>();
ColumnModel cm = new ColumnModel(configs);
Grid<Stock> grid = new Grid<Stock>(store, cm);
grid.setAutoExpandColumn("name");
grid.setBorders(true);
window.add(grid);
}
public void addStock() {
store.removeAll();
store.add(TestData.getStocks());
}
}
I attach two images, the first case and then when I close and open the window again!
Thank you!
PD: While I was writing this post I've changed the order of the actions and if I show the window first and then update the store and it works OK! Why?
I've have a grid in a Window and before I show the window I update the grid's store. The first time all it's okey and the grid renders fine, but if I close and open the window again the grid renders weird (the autoexpandcolumn it's not expanded for example) It didn't happen with 1.2
- GXT version: 2.0.1
- Host mode / web mode / both: Both
- Browser and version: IE7, Firefox 3.0
- Operating System: Windows
- Sample code:
public class Test implements EntryPoint {
private Window window;
private ListStore<Stock> store;
public void onModuleLoad() {
window = new Window();
window.setSize(500, 500);
window.setLayout(new FitLayout());
window.setMinimizable(true);
window.setMaximizable(true);
gridExample();
Button b = new Button("Click", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
addStock();
window.show();
}
});
RootPanel.get().add(b);
}
public void gridExample() {
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Company");
column.setWidth(200);
configs.add(column);
column = new ColumnConfig();
column.setId("symbol");
column.setHeader("Symbol");
column.setWidth(100);
configs.add(column);
store = new ListStore<Stock>();
ColumnModel cm = new ColumnModel(configs);
Grid<Stock> grid = new Grid<Stock>(store, cm);
grid.setAutoExpandColumn("name");
grid.setBorders(true);
window.add(grid);
}
public void addStock() {
store.removeAll();
store.add(TestData.getStocks());
}
}
I attach two images, the first case and then when I close and open the window again!
Thank you!
PD: While I was writing this post I've changed the order of the actions and if I show the window first and then update the store and it works OK! Why?