Hi,
I have a full screen constructor init of a 3T layout using DHTMLX v4.0.3 Standard Edition
In cell “b” I have attached an accordion.
var menuAccordion = mainLayout.cells("b").attachAccordion();
I then use loadStruct to load the accordions structure as this is going to come from a database and needs to be dynamic.
menuAccordion.loadStruct("data/main-menu.php");
output:'{skin: "dhx_skyblue", multi_mode: true, icons_path: "./codebase/imgs/", items: [{id: "accItem_1", height: 150, icon: "book.png", text: "Main Page"},{id: "accItem_2", height: "*", icon: "book.png", text: "Site Navigation"}]}';
This all works fine and everything renders correctly.
The issue comes when I want to get the Ids of all the cells in the accordion
menuAccordion.forEachItem(function(cell){
console.log(cell.getId());
});
this does not work
If I copy the JSON output from the ‘main-menu.php’ page and store that in a variable and use the following code instead.
var data = '{skin: "dhx_skyblue", multi_mode: true, icons_path: "./codebase/imgs/", items: [{id: "accItem_1", height: 150, icon: "book.png", text: "Main Page"},{id: "accItem_2", height: "*", icon: "book.png", text: "Site Navigation"}]}';
menuAccordion.loadStruct(data);
then the forEachItem works and console log shows the accordion cell Ids correctly.
I have also tried outputting in XML from ‘main-menu.php’ and this to has the same problem…
I have looked through the forums but cant find anyone else having this issue.
please help