-
30 Jun 2011 3:28 AM #1
[4.0.2a] Large Ext.menu.Menu incorrectly shown (Possible fix)
[4.0.2a] Large Ext.menu.Menu incorrectly shown (Possible fix)
Bug
Menus that have a lot of items, so much so that the menu is larger than the browser window, should be resized automatically to fit the window (or maxHeight) via the Ext.menu.Menu.doConstrain function. There seams to be a bug in this function, as such menues are always resized to a minimum size, where no items can be seen, only the scroll buttons.
run this to see the effect.
Fix:Code:var items = []; for(var i = 0; i < 100; i++) { items.push({text: i}) }; Ext.create('Ext.menu.Menu', {items: items}).showAt(10,10)
In the Ext.menu.Menu.doConstrain function... change:
to:Code:... delete me.height; me.setSize(); full = me.getHeight(); ...
Note: to any one that wants to use this fix, I suggest using Ext.override(Ext.menu.Menu, { doConstrain: function() {....}}); as opposed to altering ext-all.js/ext-all-debug.js.Code:... full = me.getHeight(); delete me.height; me.setSize(); ...
-
2 Jul 2011 3:58 AM #2
And this bug also show in the "Toolbar with Menus" examples. Just click the "Scrolling Menu" button in toolbar.
BTW: how to specify a menu's height (or items count) and explicitly use the scroll buttons?
-
3 Jul 2011 8:54 AM #3
Look into the maxHeight option for the Ext.menu.Menu object... This should work (but doesn't)... you may need to look into the Ext.menu.Menu.doConstrain function again, to find out whats going wrong.
-
14 Jul 2011 10:48 AM #4
Thanks. This override worked.
The respective scrollers still remain visible and enabled when scrolled to the very top or bottom, but that's a lesser bug/usability issue.
-
14 Jul 2011 12:49 PM #5
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote