context menu in a datagrid in flex 4

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

context menu in a datagrid in flex 4

Nitin Gopi-3
Hi
I am trying to set the context menu to a datagrid. The process I am using is like this


cm = new ContextMenu;
cm.hideBuiltInItems();
var cmi:ContextMenuItem = new ContextMenuItem('say hello');
cm.customItems.push(cmi);

Inside datagrid I am using contextMenu="{cm}"

This work perfectly fine with flex 3.6 , but when I compile it with flex 4.6 the contextmenu doesn't show.

Thanks
Nitin Gopi
Reply | Threaded
Open this post in threaded view
|

Re: context menu in a datagrid in flex 4

Nitin Gopi-3
Hi All,
It worked . If we assign the context menu using the id of datagrid then the context menu works, for example if the id of datagrid is dg, then by using dg.contextmenu = cm. But I wonder why it doesn't work by assigning it directly in datagrid using binding.

Thanks
Nitin Gopi