ok - cracked the code to get all groups collapsed - as in screenshot
[ATTACH=CONFIG]18426[/ATTACH]
In the postcreate function find and alter as belowif (this.data._subLayerInfos) { //acm added to collapse groups at the start this.toggler.hide() //end acm addition
and a bit later//ACM also changed this line to get groups initial expand set //dojo.addClass(this.iconNode, a ? "dijitTreeExpandoOpened" : "dijitTreeExpandoClosed") dojo.addClass(this.iconNode, a ? "dijitTreeExpandoClosed" : "dijitTreeExpandoClosed")
So far it appears to work. The second part could be neater, but doing it this way you can see it has been changed to always return "dijitTreeExpandoClosed"
ACM
Is there any way to have the map service layer initially expanded but all collapsible groups within the map service (unique value renderers and group layers) collapsed?
var show = this.data.visible; // if it is a group layer and no child layer is visible, then collapse if (this.data._subLayerInfos) { var noneVisible = true; dojo.every(this.data._subLayerInfos, function(info) { if (info.visible) { noneVisible = false; return false; } return true; }); if (noneVisible) show = false; } if (this.data.collapsed) show = false; if (this.iconNode && this.iconNode.src == this.blank) { dojo.addClass(this.iconNode, 'dijitTreeExpando'); dojo.addClass(this.iconNode, show ? 'dijitTreeExpandoOpened' : 'dijitTreeExpandoClosed'); } if (this.containerNode) dojo.style(this.containerNode, 'display', show ? 'block' : 'none'); if (this.rootLayerTOC.toc.style == 'standard' && this.iconNode && this.checkNode) { dojo.place(this.iconNode, this.checkNode.domNode || this.checkNode, 'before'); }
TOC widget to not collapse layer Groups when it is turned off?
Hi,
Use these tags in layerInfo:
collapsed: true,
autoToggle: false
Thanks.