I have created a Dojo DropDownButton using dijit/form/DropDownButton and created MenuItems using dijit/MenuItem. I am trying to create sub-menu items for the MenuItems so that the options are organized nicely and the user can have sub options to select from.
Is there any way to do this so that the dropdown options look like this:
Vegetables
Carrots
Potatoes
Tomatoes
Fruits
Apples
Oranges
instead of this (what I currently have):
Vegetables
Carrots
Potatoes
Tomatoes
Fruits
Apples
Oranges
Vegetables and Fruits should be dijit/PopupMenuItems and each one should contain a dijit/Menu and the menu should have the corresponding dijit/MenuItems.
The declarative menu example demonstrates it. In your case, the only difference is that instead of a context menu, the top level menu is a dijit/DropDownMenu.
http://dojotoolkit.org/reference-guide/1.9/dijit/Menu.html#declarative-markup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With