Flex 3: Possible to add a Context Menu to a ItemRenderer inside a DataGrid?
Posted
by gmoniey
on Stack Overflow
See other posts from Stack Overflow
or by gmoniey
Published on 2010-05-19T02:44:45Z
Indexed on
2010/05/19
2:50 UTC
Read the original article
Hit count: 309
flex
|actionscript-3
I have an ItemRenderer that is shared by several applications (inside a DataGrid), and I would like to add a context menu to it (rather than in each application). The renderer is derived from the Canvas class, and the code to create the context menu looks something like:
var menuItem:ContextMenuItem = new ContextMenuItem("Test");
menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextCallback);
var customContextMenu:ContextMenu = new ContextMenu();
customContextMenu.hideBuiltInItems(); //hide flash menu
customContextMenu.customItems.push(menuItem);
this.contextMenu = customContextMenu;
However, when I right click on the cell in the datagrid, I get the default Flash Context Menu. Is this not possible?
© Stack Overflow or respective owner