load menu with script on attachment to 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.

attmenu.addNewSibling(“sib1”,“sib2”,“SiblingMenu”,“false”);

The first parameter of the addNewSibling method is the id of the element after which a new one will be inserted. As it is the first item, this paramater should be null.

Please see the sample dhtmlxMenu/samples/01_init/04_first_item_usual.html