Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ooypunk on Nov 19, 2009 00:47
open dhtmlx forum
Breakdown with "polygon is undefined"

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: http://localhost/werk/admini2_extern/HTML/dhtmlx/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.
Answer posted by Alex (support) on Nov 19, 2009 01:29

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");

Answer posted on Nov 19, 2009 02:57
Totally forgot about that. I'm very sorry.
Thanks for pointing it out!