LayerList widget expand on startup

1476
15
12-12-2016 06:16 AM
Highlighted
Occasional Contributor

Hello,

I want to know if there is a way to expand RootLayer at the LayerList widget startup.

Thanks,

Naty

Reply
0 Kudos
15 Replies
Highlighted
Occasional Contributor III

Natasha, since you have only one layer in this map service, you could try adding it to your map as an individual feature layer.  Then you would not see the root node.  Maybe you tried this already... feature layers do have some drawbacks that may or may not apply, but it could work.

Highlighted
Occasional Contributor II

Hey Robert, I tried implementing this but it's not working.

Is this snippet supposed to replace the existing 'onMenuClick' code or go after it?

Existing last line:

this.own(p(this.operationsDropMenu, "onMenuClick", m.hitch(this, this._onOperationsMenuItemClick)))

Thanks!

Warren

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Warren,

  It goes after it but based on the code you provided you are using minified code and that poses a problem. I am not sure it will work for you.

Reply
0 Kudos
Highlighted
New Contributor III

Hey @RobertScheitlin__GISP - this is great! (sorry for bringing up an old post by the way). This really helped make our grouped layer lists more user friendly in our new app.

 

I did encounter one issue...admittedly, I didn't test this before the code change so I'll go back and verify... however after the change, if/when I choose to "Turn All Layers On", nothing happens. Similarly, if I opt to "Turn All Layers Off" only the parent / root parent turns off now. Have you experience this? We are using the Foldable theme in WABD 2.17. Thanks for any help you can provide!

 

 

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Rex,

   The "turn all layers on" menu option only turns parent layers on it does not alter sublayer visibility.

Highlighted
MVP Esteemed Contributor

Naty,

   Don't forget that your original question as already been answered.