简体   繁体   中英

How do I add a scroller to a Menu in Flex 4

In flex 4 I'm using a PopUpButton with a Menu populated with records from the database.

For one of our clients, the data provider of the Menu has more than 50 elements.

When they click on the Menu it expands beyond the height of the screen without showing a scroller or responding to the mouse-wheel. So in effect there is no way to access the lower items on the menu.

So I need to somehow restrict the height of the menu and add a scroller.

The rowCount and maxHeight commands are having no effect.

var companyContextMenu:Menu=new Menu();
companyContextMenu.maxHeight=400;
companyContextMenu.rowCount=20;

The same code was working fine before migrating to Flex 4.

Any help is much appreciated.

In Flex there is a big different regarding scrollbars between version 3 and 4.

First, please don't mix the halos and the sparks. Then put a scroller-Tag around the menu, that should become a scroller. Just the container Group, DataGroup, VGroup, HGroup and TitleGroup implement IViewport and can handle the scoller-tag ouround them.

So, put your menu in one of the container above. Is this not handle for you, please post your code.

BR Frank

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM