views:

634

answers:

2

Hi, I am using a ContextMenu for an AdvancedDataGrid in my application. I could implement the normal context menu for the grid. Now, I am planning to make the context menu dynamic.

For example, if I click on a particular cell, I need to see only the items related to that cell in the Context Menu. Is there any way we can do that?

A: 

ContextMenu class contains a customItems property which is (quoting from Adobe livedocs):

An array of ContextMenuItem objects. Each object in the array represents a context menu item that you have defined. Use this property to add, remove, or modify these custom menu items.

To add new menu items, you create a ContextMenuItem object and then add it to the customItems array (for example, by using Array.push()). For more information about creating menu items, see the ContextMenuItem class entry.

Amarghosh
Yes, I am already doing that. All I need is dynamically changing items when I am right clicking the cells.Lets say, I have a cell with value 'Y'. If I right click, the context menu should contain, 'Change to N' and viceversa.Any suggestions?
online19
A: 

I found the solution for this. Quite simple:

http://www.pubbs.net/flex/200905/73331/

online19