id | string, id of the tab |
index | integer, index of the item in the menu |
event | object, optional, DOM Event object |
let sidebar = new w2sidebar({
name : 'sidebar2',
img : 'icon-page',
menu : [
{ id: 1, text: 'Item 1' },
{ id: 2, text: 'Item 2' },
{ id: 3, text: 'Item 3' },
],
nodes: [
{ id: 'id-1', text: 'Level 1', hidden: true },
{ id: 'id-2', text: 'Level 2', expanded: true, nodes: [
{ id: 'id-2-1', text: 'Level 2.1' },
{ id: 'id-2-2', text: 'Level 2.2' }
]},
{ id: 'id-3', text: 'Level 3' }
]
});
xxxxxxxxxx
w2ui.sidebar.menuClick('id-1', 0);