带有标题窗口的数据网格中的上下文菜单



我想在标题窗口中添加一个带有数据网格的上下文菜单,添加后没有任何事情发生。

[Bindable]      
public var cm:ContextMenu;
private function init(event:FlexEvent):void
{        
 var cmi:ContextMenuItem = new ContextMenuItem("View item...", true);   
 cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
                                           ontextMenuItem_menuItemSelect);    
 cm = new ContextMenu();                    
 cm.hideBuiltInItems(); 
 cm.customItems = [cmi];
} 

我在标题窗口的creationComplete事件上调用init函数。

请帮助! !

我也遇到过这个问题。为了让它在我的项目中工作,我必须在TitleWindow:

上显式地设置这两个属性。
// "this" being the TitleWindow. Doing this during creation complete event.
this.mouseEnabled = true;
this.skin.mouseEnabled = true;

最新更新