Hi !
In my application, I create a Menu which is showned with a double
click. Here is the code :
In my MXML application :
========================
XML for the menu
----------------
<mx:XML id="tasksMenuData">
<root>
<menuitem label="Nouvelle tâche" eventName="newTask" enabled=""/>
<menuitem label="Supprimer" eventName="deleteTask" enabled=""/>
<menuitem label="Editer" eventName="editTask" enabled=""/>
</root>
</mx:XML>
DataGrid with a double click to show the menu
---------------------------------------------
<mx:DataGrid id="tasksDataGrid" right="10" left="10" top="40"
bottom="10" doubleClickEnabled="true"
doubleClick="showMenu('tasksDataGrid');">
An actionScript file : menu.as
==============================
private function showMenu(name:String):void
{
switch (name)
{
case 'tasksDataGrid' :
menu = Menu.createMenu(tasksDataGrid, tasksMenuData, false); break;
}
menu.labelField = "@label";
menu.addEventListener("menuShow", menuHandler2);
//menu.addEventListener("itemClick", menuHandler);
menu.show(mouseX, mouseY);
}
And, before to show the menu, for example, if any item is selected in
my DataGrid, I would like to disable the label "Supprimer", in my menu.
But, I don't know to access to a particularly node/item or my menu.
Thanks to help me !!
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/