Show legend in Layer List widget by default

5694
14
Jump to solution
01-31-2017 11:52 AM
AndrewL
Occasional Contributor II

I would like the Layer List to display the legend by default (instead of clicking on the layer for the dropdown legend to appear).

I tried editing the following code in LayerListView.js where I added the "unfold" text, but all that does is update the triangle orientation like the screenshot below. Thank you.

imageShowLegendDiv = domConstruct.create('div', {
'class': 'showLegend-div jimu-float-leading unfold',
'imageShowLegendDivId': layerInfo.id
}, layerTdNode);

0 Kudos
14 Replies
JacksonTrappett
Occasional Contributor II

That worked great, thank you!

RexRobichaux
Occasional Contributor

Hey Robert- thanks for all of your help on this! We are using WABD 2.5 and I implemented the codeblock above into the \LayerList\LayerListView.js file, but am seeing no change in behavior whether or not a layer is turned on or off (no layer symbology is presented) .

I'm wondering if you've had a chance to test this at WABD versions above 2.4, or if app theme (we are using the launchpad theme) might have anything to do with it? Thanks again!

-Rex

0 Kudos
AnaHiraldo-Gomez
New Contributor III

Thanks everyone, but if I am just using out of the box, not customized nor in our server,  Web App Builder this is not possible.  We do it this way because we don't want to create more work when upgrading our servers. ESRI can upgrade and may run into compatibility issues. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ana,

   Then you are out of luck, unless esri adds this ability.

0 Kudos
ikbelkachbouri
New Contributor II

Hi , 

Please i search Legend widget with Classification method . . 

0 Kudos