This is a migrated thread and some comments may be shown as answers.

Menu item set disable client side

2 Answers 44 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Pic
Top achievements
Rank 1
Pic asked on 04 Feb 2012, 10:25 PM
Hi guys,

I am talking about contextmenu. I am trying to make a MenuItem not visible.
Let's say a user right-click on a button, a ContextMenu appear and give him some choises.
I have a javascript code that will determine what options (MenuItem) will be available for him.
I have managed to enable/disable the menuitems following this library but I can't figure out how to make the MenuItem not visible (rather than disabled).

Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 06 Feb 2012, 05:35 AM
Hello,

Try with set_visible() method.
JS:
sender.set_visible(false); // for menu
args.get_item().set_visible(false); // for a menu item

Thanks,
Princy.
0
Pic
Top achievements
Rank 1
answered on 06 Feb 2012, 08:39 PM
Thanks a lot Princy
Tags
Menu
Asked by
Pic
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Pic
Top achievements
Rank 1
Share this question
or