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.
On Sun, May 5, 2013 at 5:56 PM, Nitin Gopi <nitin.g...@gmail.com> wrote: > 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 , but when I compile it with flex 4.6 > the contextmenu doesn't show. > > > > > > > On Sat, May 4, 2013 at 5:07 PM, Lucas Junqueira <lucas_junque...@yahoo.com > > wrote: > >> How are you setting the context menu? It works perfecly for me on flex >> 4.6 and also on flex 4.9.1. My setup: >> >> this._menu = new ContextMenu(); // _menu is a private var for me >> var about:ContextMenuItem = new ContextMenuItem("about text", true, >> false); // just an about message without any actions >> var site:ContextMenuItem = new ContextMenuItem("visit my site"); // a >> link to my site >> site.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMySite); >> this._menu.customItems.push(about, site); >> this.contextMenu = this._menu; >> >> private function onMySite(evt:ContextMenuEvent):void { >> navigateToURL(new URLRequest("http://www.mysite.com/"), "_blank"); >> } >> >> >> >> ________________________________ >> De: Nitin Gopi <nitin.g...@gmail.com> >> Para: users@flex.apache.org; flex_in...@googlegroups.com >> Enviadas: Sábado, 4 de Maio de 2013 5:39 >> Assunto: context menu in flex 4 >> >> >> Hi >> The context menu is not working in flex 4. >> I compiled a project in flex 3.6 the context menu is working, but when I >> recompiled the project in flex 4.6 sdk the context menu is not working. >> Then I tried to create a new project in flex 4.6 and tried using context >> menu, but its still not working. >> Any idea how to show context menu in flex 4.6 sdk? >> >> Thanks >> Nitin Gopi >> >> -- >> You can only depend on yourself. The cavalry ain't coming. >> > > > > -- > You can only depend on yourself. The cavalry ain't coming. > -- You can only depend on yourself. The cavalry ain't coming.