I’m trying to follow the Mixed Initialization example with little success. I would like to add submenu items in script after loading the original menus from XML.
XML file:
<?xml version='1.0' encoding='iso-8859-1'?>
Thank again for a great product!
The XML loading is async, so you need to call additional code only after xml loaded
helpMenuBar.loadXML(“helpMenu.xml”,function(){
var subMenu = helpMenuBar.getPanel(“legend”);
var pItem = new dhtmlXMenuItemObject("_Programs",“Programs”,null,null,"");
helpMenuBar.addItem(subMenu,pItem);
});
helpMenuBar.showBar();
That worked great, thanks!
How can I add an item to an existing submenu? The code above appends the item after the last existing item.
How can I add an item to an existing submenu?
By using panel parameter you specified to which panel item will be added.
>>The code above appends the item after the last existing item.
addItem command adds new element to the end of pannel, the API doesn’t allow to add new element is specific place.
Thanks. I decided to just go ahead and build the entire menu from script. It worked well. Thanks for the great support.