Hello,
A strange problem arose this morning. This code works fine:
var menu = new dhtmlXMenuObject(“div_menu”, ‘dhx_black’);
menu.addNewSibling(null, “taken”, “Taken”, false);
menu.addNewChild(“taken”, 0, “taken&deel=overzicht”, “Overzicht”, false, “grid.gif”);
menu.addNewChild(“taken”, 2, “taken&deel=wijzigen&idx=toevoegen”, “Nieuw”, false, “new.gif”);
But this doesn’t:
var menu = new dhtmlXMenuObject(“div_menu”, ‘dhx_black’);
menu.addNewSibling(null, “taken”, “Taken”, false);
menu.addNewChild(“taken”, 0, “taken&deel=overzicht”, “Overzicht”, false, “grid.gif”);
menu.addNewSeparator(“taken_sep”);
menu.addNewChild(“taken”, 2, “taken&deel=wijzigen&idx=toevoegen”, “Nieuw”, false, “new.gif”);
Everything after the separator (including the separator itself) isn’t shown. The error message is “Fout: polygon is undefined
Bronbestand: localhost/werk/admini2_extern/HT … /dhtmlx.js
Regel: 1497”.
Why is polygon not defined with the separator, but is on the NewChild line?
Is there a way to check what is going wrong?
Any help is appreciated. Thanks in advance.
Hello,
the first attribute of addNewSeparator method is the id of the previous item. Therefore please, use
menu.addNewSeparator(“taken&deel=overzicht”);
instead of
menu.addNewSeparator(“taken_sep”);
Totally forgot about that. I’m very sorry.
Thanks for pointing it out!