Dojo context menu - set menu item status dynamically - menu

I am trying to implement a context menu on a dijit tree, and the context menu should display different contents and enable/disable the menu items based on which tree node I right-clicked on. Basically what I need is a pre-processing function that gets called before the context menu is displayed where I can run some logic to determine which menu items to show/hide, enable/disable, etc. I feel like this is a very basic functionality for context menus but wasn't able to find the solution, so I'm asking people for help.
Any help would be appreciated. Thanks!

Dijit Tree has no built-in support for context menus, but you can use the Menu widget in conjunction with the Tree. The Menu widget is used for context menus, with right-click which can really suite your use-case.
Documentation and examples here:
https://dojotoolkit.org/reference-guide/1.10/dijit/Tree.html#context-menu
https://dojotoolkit.org/reference-guide/1.10/dijit/Menu.html

Related

How do I define the items in the menu row or even better have the default format menu item appear in the toolbar?

I changed menu to this:
menubar: 'format table tools help'
But what appears in the menu in my editor is just format. Table, tools, and help don't appear. Why is that so?
Also, if I want to get rid of the menubar I know I need to set
menubar: false
but is there a way of getting that nice format item from the menubar into the toolbar?
Thanks.
In order for the item to appear in the menu you also need to load the plugin itself. If (for example) you don't load the help plugin TinyMCE won't show a Help menu because the underlying functionality is not loaded.
is there a way of getting that nice format item from the menubar into
the toolbar?
The short answer is "no". A menu item and a toolbar item are different. That being said, many of the capabilities exposed via the Menubar can also be exposed via the Toolbar.
Here is an example of loading both the Help menu option as well as the toolbar button.
https://fiddle.tiny.cloud/S5haab

Chrome Extension - can I add a search field to the context menu?

I'm wondering if it's possible to customize the chrome context menu? Specifically I want to add a search field to narrow down the options in my context menu. Right now I have a lot of options that will popup in one of my sub-context menus and it would be helpful if at the top of the sub-context menu I could build in a filter/search functionality. Looking at the docs this doesn't seem possible. Wondering if anybody has attempted this?

How to disable a whole drop-down menu on Electron?

I am developing a desktop application with Electron. I have added some items to the menu bar.
Sometimes I open some modal forms with bootstrap in the program. When these popups are open I want to disable the menu items.
I have made some research and some people says that the menu bar could be removed. But I do not want to create my own HTML menu.
And there is another option, maybe the best approach. Disabling all the options of each dropdown menu. Each menuitem has an enabled attribute, so it can be changed in runtime.
Is there way to avoid dropping down the menu and disable the drop-down menu?
Dynamic menus are not currently supported. This has something to do with the fact that the menus in Electron use the Chromium menu code which has no dynamic features.
When your File menu is empty, you could replace the entire menu with one that does not have the File menu in it?

Orchard CMS 1.5 Navigation sub menus

New to Orchard. I have been looking for some documentation on how the menus actually work. It appears that you can have hierarchical menus, but I cannot find any good information on this.
It took me a while to figure this out too. You can see how to create a navigational menu in this video (around 8:45, but i'd recommend watching the entire video).
Basically, you need to drag & drop an item below and to the right of another content item in order to make a nested menu item.
Yes, you can. Since 1.5 you can create hierarchical menus from Navigation admin screen. Hierarchy (and reordering) of items can easily be created by drag & drop.
Navigation screen is used to define your menus. In order to display a defined menu you need to put Menu Widget in the zone of your choice. When you create that widget you need to choose which menu is it going to display. Besides the choice of the menu, you can also choose some other optional parameters if you need to customize the display more (eg. display only certain level).

How to disable or apply custom menu to GTK (PyGTK) Notebook pages?

I am trying to apply custom menu to tab pages on my notebook control. I need to be able to select certain specific action for the entire page and i figured the tab label would be the best place to start.
So, i created a EventBox, applied Label as its child, and bound event callbacks to button-pressed-event and it... works.. kindof.
What i get is two menus: one is the one I create, and on top of it - the one created by GTK Notebook. to select something from my custom menu i need to escape the notebook menu first, and i certainly don't like it.
so the question is: how do I disable gtk notebook menus? or how can i set my own, custom menu, with my own, custom callbacks? I don't want to list all the available tab pages in the menu - it's introducing too much noise, so adding menu labels to the existing menu is not really the way to go.
thanks bunches
GtkNotebook should only show the tab selector if enable-popup is true. It defaults to false, so you've probably enabled it by mistake.

Resources