RE: Nilu's TOC - collapsible property for layers not working.

Discussion created by ganeshssac on Jan 14, 2014
Latest reply on Jan 22, 2014 by ganeshssac
Hi Nilu, I need a help from you. Our organization Web mapping application is hosted on ArcGIS online server and it uses the webmap id from and all our dynamic layers are referenced via this webmap id. We have a function in the application which adds legends and layers using agsjs TOC. The problem is, I want to set this collapsible property of all layerinfos to true. Even though, I set this property to true, it is not collapsible. Can you fix this one or give some idea what would be the problem in my code. Here is my code below.
function addLegend(layerInfo) { var legendTb = new dijit.form.ToggleButton({ showLabel: true, label:, title:, checked: true, iconClass: 'esriLegendIcon', id: 'legendButton' }, dojo.create('div')); dojo.byId('webmap-toolbar-left').appendChild(legendTb.domNode); dojo.connect(legendTb, 'onClick', function () { navigateStack('legendPanel'); }); var legendCp = new dijit.layout.ContentPane({ title:, selected: true, region: 'center', id: "legendPanel" }); dijit.byId('stackContainer').addChild(legendCp); dojo.addClass(dojo.byId('legendPanel'), 'panel_content'); var legendDijit = new agsjs.dijit.TOC({ map: map, layerInfos: layerInfo, collapsed: true, // slider: true }, dojo.create('div')); dojo.byId('legendPanel').appendChild(legendDijit.domNode); navigateStack('legendPanel'); if (dojo.isIE === 8) { setTimeout(function () { legendDijit.startup(); }, 100); } else { legendDijit.startup(); } }