How can I use the length of an array to create the number of children in an Accordion. For instance, if the length of the array is 8, I create 8 children from the accordion. New to Dojo.
Create array length number of Accordions
107 Views Asked by user3078335 At
2
There are 2 best solutions below
0

You'll need to add your content to the contentpanes.
require(["dijit/layout/AccordionContainer", "dijit/layout/ContentPane", "dojo/domReady!"],
function(AccordionContainer, ContentPane){
var acc = new AccordionContainer();
for(var i = 0; i < arr.length; i++) {
acc.addChild(new ContentPane());
}
});
Assuming that dataArrray is an array of objects holding the data for the contentpane.