laod menu with script on attachment with tabbar

Hi,

i am trying to load menu items from script, after the menu is attached to the tabbar,

if i do something like this:

  1. var tab = new dhtmlXTabbar(“tabdiv”,“top”);
  2. tab.addTab(“sid”,“Tab1”,“100px”)
  3. var attmenu = tab.cells(“sid”).attachMenu();
    4 . attmenu.addNewSibling(“sib1”,“sib2”,“SiblingMenu”,“false”);

so now the line 4 fails , but if i do

attmenu.loadXML(“path.xml”);

it works fine,
I need to create the menu using script, is there a way to do it , or is it a limitation of the component.

Hi,

use null as the first parameter of the start item:
attmenu.addNewSibling(null,“sib2”,“SiblingMenu”,“false”);

Here is the sample dhtmlxMenu/samples/01_init/04_first_item_usual.html