marc76
13 Oct 2010, 4:02 AM
Hi all,
I think a found a bug: when scrolling vertically at least a bit in the browser window, you can not use the column selection submenu of a grid column header anymore, it just disappears when the mouse comes over it. For reproducing just use the following code, make the browser window small enough so that you can scroll down a bit (scrolling away the panel header is enough), and try to (de-)select columns in the menu..
My system: Win XP SP3, GWT 2.1.0RC1, GXT 2.2.0, Firefox 3.5.10/Chrome dev 7.0.517, both hosted and web mode.
I think the bug is in MenuItem.shouldDeactivate(), where probably some y-coordinate is not correctly detected.
Here the code:
public class Test implements EntryPoint {
public void onModuleLoad() {
RootPanel rootPanel = RootPanel.get();
LayoutContainer cont = new GridExample();
rootPanel.add(cont);
}
class GridExample extends LayoutContainer {
private ColumnModel cm;
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
setLayout(new FlowLayout(10));
getAriaSupport().setPresentation(true);
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Company");
column.setWidth(200);
column.setRowHeader(true);
configs.add(column);
column = new ColumnConfig();
column.setId("symbol");
column.setHeader("Symbol");
column.setWidth(100);
configs.add(column);
ListStore<Stock> store = new ListStore<Stock>();
store.add(TestData.getStocks());
cm = new ColumnModel(configs);
ContentPanel cp = new ContentPanel();
cp.setBodyBorder(true);
cp.setHeading("Basic Grid");
cp.setButtonAlign(HorizontalAlignment.CENTER);
cp.setLayout(new FitLayout());
cp.getHeader().setIconAltText("Grid Icon");
cp.setSize(300, 300);
final Grid<Stock> grid = new Grid<Stock>(store, cm);
grid.setAutoExpandColumn("name");
grid.setBorders(false);
grid.setStripeRows(true);
grid.setColumnLines(true);
grid.setColumnReordering(true);
cp.add(grid);
add(cp);
}
}
class Stock extends BaseModelData {}
static class TestData {
public static List<Stock> getStocks() {
List<Stock> stockList = new ArrayList<Stock>();
Stock stock1 = new TestWebApp().new Stock();
stock1.set("name", "name");
stock1.set("symbol", "symbol");
stock1.set("date", new Date());
stockList.add(stock1);
return stockList;
}
}
}
Kind regards,
Marc
I think a found a bug: when scrolling vertically at least a bit in the browser window, you can not use the column selection submenu of a grid column header anymore, it just disappears when the mouse comes over it. For reproducing just use the following code, make the browser window small enough so that you can scroll down a bit (scrolling away the panel header is enough), and try to (de-)select columns in the menu..
My system: Win XP SP3, GWT 2.1.0RC1, GXT 2.2.0, Firefox 3.5.10/Chrome dev 7.0.517, both hosted and web mode.
I think the bug is in MenuItem.shouldDeactivate(), where probably some y-coordinate is not correctly detected.
Here the code:
public class Test implements EntryPoint {
public void onModuleLoad() {
RootPanel rootPanel = RootPanel.get();
LayoutContainer cont = new GridExample();
rootPanel.add(cont);
}
class GridExample extends LayoutContainer {
private ColumnModel cm;
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
setLayout(new FlowLayout(10));
getAriaSupport().setPresentation(true);
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Company");
column.setWidth(200);
column.setRowHeader(true);
configs.add(column);
column = new ColumnConfig();
column.setId("symbol");
column.setHeader("Symbol");
column.setWidth(100);
configs.add(column);
ListStore<Stock> store = new ListStore<Stock>();
store.add(TestData.getStocks());
cm = new ColumnModel(configs);
ContentPanel cp = new ContentPanel();
cp.setBodyBorder(true);
cp.setHeading("Basic Grid");
cp.setButtonAlign(HorizontalAlignment.CENTER);
cp.setLayout(new FitLayout());
cp.getHeader().setIconAltText("Grid Icon");
cp.setSize(300, 300);
final Grid<Stock> grid = new Grid<Stock>(store, cm);
grid.setAutoExpandColumn("name");
grid.setBorders(false);
grid.setStripeRows(true);
grid.setColumnLines(true);
grid.setColumnReordering(true);
cp.add(grid);
add(cp);
}
}
class Stock extends BaseModelData {}
static class TestData {
public static List<Stock> getStocks() {
List<Stock> stockList = new ArrayList<Stock>();
Stock stock1 = new TestWebApp().new Stock();
stock1.set("name", "name");
stock1.set("symbol", "symbol");
stock1.set("date", new Date());
stockList.add(stock1);
return stockList;
}
}
}
Kind regards,
Marc