LayerList widget expand on startup

3558
15
12-12-2016 06:16 AM
NatashaManzuiga
Occasional Contributor

Hello,

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

Thanks,

Naty

0 Kudos
15 Replies
RyanKelso
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.

WarrenMedernach
Occasional Contributor III

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

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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.

0 Kudos
RexRobichaux
Occasional Contributor

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!

 

 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rex,

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

RobertScheitlin__GISP
MVP Emeritus

Naty,

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