To get the details of child (of accordian container) that the user is clicking on, I subscribed to this topic - "-selectChild". Working fine, but later I wanted to keep all the content panes collapsed by default inside a accordian container, I searched on the internet, couldn't find it, but tried it by calling selectChild(0) on accordian container. It worked but after adding this line (selectChild(0)), I am getting error when user clicks on any pane
Error that I am getting:
Uncaught TypeError: Cannot read property 'containerNode' of undefined
Code(not complete code)
topic.subscribe("accordianContainerId-selectChild", function(pane){
console.log('user selected pane:'+pane)
});
aContainer = new AccordionContainer({id: 'accordianContainerId', "isLayoutContainer": true,style:"height: 100%"});
aContainer.addChild(new ContentPane({
id: 'test',
title: 'test',
content: "<div>test</div>", doLayout: true
}));
aContainer.placeAt("markup");
aContainer.startup();
aContainer.selectChild(0);