PDA

View Full Version : [2.0.1] Problem with menus in Grid.



dron
7 Aug 2009, 6:22 AM
Hello,

- Description
The menus of the table heading are becoming too small sometimes.

- GXT version
[2.0.1] jar and *.css files upgraded
- Host mode / web mode / both
both
- Browser and version
All
- Operating System
Windows XP
- Sample code

I attach the screenshots the same page.

Could you give an advice how to deal with it if it's not a bug.

Best regards.

sven
7 Aug 2009, 6:29 AM
Please read the bugforum guidelines. Moved this to the help forum for now. How to reproduce this?

I dont see it here:

http://www.extjs.com/examples/explorer.html#basicgrid

dron
13 Aug 2009, 11:47 PM
It's very hard to reproduce this bug outside my project.
The problem was in scrolling in the Menu (It seems that Menu sometimes generate bad height of a scroll).

I solve this problem in a such way:

add listener to the grid:


grid.addListener(Events.HeaderContextMenu, getOnContextMenu());
and disable the scrolling



private Listener<GridEvent> getOnContextMenu() {
return new Listener<GridEvent>() {
public void handleEvent(GridEvent e) {
Menu menu = e.getMenu();
menu.setEnableScrolling(false);

ColumnConfig columnConfig = e.getGrid().getColumnModel()
.getColumn(e.getColIndex());
if (columnConfig.isSortable()) {
((MenuItem) menu.getItem(2)).getSubMenu().setEnableScrolling(false);
} else {
((MenuItem) menu.getItem(0)).getSubMenu().setEnableScrolling(false);
}
}
};
}