| Page 1 of 1 | [ 2 posts ] |
|
Is there a way to get the name of the context menu item clicked. For example in the following code:
Code: function showContextMenu(eventType, args) { var menuItem = args[1]; // The MenuItem that was clicked switch (menuItem.index) { case 0: // do some thing break; case 1: // do some other thing break; case 2: // do something else break; } } I use the index of the menu item to call functions. I want to call functions based on the name of the menu item clicked to increase readability. I am unable to get the name using the "value" field in menu item. Is there a way to do this. |
Matt ParkerYUI Contributor
|
Hi,
Assuming this function is your onclick handler for the menu items, there's a third argument that has the menu item value: Code: function showContextMenu(eType, aArgs, oItem) { var value = oItem.value; // ... etc } Matt |
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group