I'm developing a WAB app using Developer edition 2.4. I had a couple questions about the Layer List widget:
1. Is it possible to have the widget open when the map first loads?
2. Is it possible to have a map service containing sub-layers to be expanded by default? I have an image of what I would prefer.
Solved! Go to Solution.
Patrick,
Sure, to have the widget open at start then you just have to enable the open at start in the widgets settings:
The widget added from the widgets collection can be set to open automatically when apps start. To do so, click the dot on the widget to change it to dark green. A maximum of two widgets can open automatically: one is on the controller and another in the placeholder.
For having the layers expanded by default see this thread:
https://community.esri.com/thread/189567-show-legend-in-layer-list-widget-by-default#comment-663376
Patrick,
Sure, to have the widget open at start then you just have to enable the open at start in the widgets settings:
The widget added from the widgets collection can be set to open automatically when apps start. To do so, click the dot on the widget to change it to dark green. A maximum of two widgets can open automatically: one is on the controller and another in the placeholder.
For having the layers expanded by default see this thread:
https://community.esri.com/thread/189567-show-legend-in-layer-list-widget-by-default#comment-663376
Thanks! Not sure how I missed that. I ended up using a CSS trick to have the list expanded:
/* Layer list expanded by default */
.jimu-widget-layerList table.layer-sub-node {
display: table;
}
/* layer list legend hidden so it loads properly */
.jimu-widget-layerList table.layer-sub-node .legends-loading-img {
display: none;
}
Patrick,
Hmm. never seen it done with css. Don't forget to mark this question as answered.
Patrick,
Do you have any links you could share for how to implement that CSS script? I would love for my layers list to open as expanded, but I'm not sure how to implement the CSS script. Do you have any additional resources you could share in this tread on this procedure?
Thank you!
Also interested in what you did to the CSS to keep the layer list expanded; not exactly sure which file gets manipulated.
Robert,
Once the widgets are grouped can one widget be defaulted to expand and the rest be closed? I have multiple layer list widgets in one grouping, I would like the first one to display when the group is opened and the others to be closed. Below is what it looks now.
Have you seen this thread?
https://community.esri.com/thread/201369-wab-how-do-i-edit-the-group-widget-layout
I've added a Gist on GitHub with the CSS rules for achieving this. I always create a style.css file for each WAB project, where I store the default rules in the style tag, along with my custom styles.
There are two rules to achieve the result. A sample map can be found at 911 CAD Map .