Hi!
I need some help with one situation. I'm creating a dynamic menu, with information from the backend of my application. But it is giving me an error that I replicated with the menu sample of the documentation.
I know the creation is out of a normal order but is the way the menu must be created. Any workaround will help!
const itemSubMenu = new MenuItem(
{
text : 'Sub menu',
});
const subMenu = new Menu(
{
icon : 'b-fw-icon b-fa-play',
text : 'Play'
});
itemSubMenu.menu = subMenu;
const menu = new Menu({
anchor : true,
autoShow : false,
items : [
{
icon : 'b-fw-icon b-icon-add',
text : 'Add'
},
{
icon : 'b-fw-icon b-icon-trash',
text : 'Remove'
},
{
icon : 'b-fw-icon b-icon-lock',
disabled : true,
text : 'I am disabled'
},
itemSubMenu
],
// Method is called for all ancestor levels
onItem({ item }) {
Toast.show('You clicked ' + item.text);
}
});