On a web app created with webapp builder, how can I make the legend on the sidebar open at start?
I tried to insert this in \widgets\Legend\config.json
"openAtStart": true
It's not working... Any idea?
Full config.json :
{ "legend":{ "arrangement": 0, "autoUpdate": true, "respectCurrentMapScale": true, "openAtStart": true } }
I have tested this and it works great for me. Did you try to add the "openAtStart": true, to the main config file in the root of the application NOT in the \widgets\Legend\config.json? This config.json file is at the same level as your index.html file.
By the way, if you notice for the legend widget, the main config file does not even reference a legend config file by default.
If you change a default attribute for the widget then it will create a new config file in configs/Legend/config_Legend.json and add the line of code to reference that new config.
Add the "openAtStart": true to this file in the Legend widget and it should work. If not then try clearing your browser cache and reload.
As I am looking at this I realize that this works for the default Foldable Theme and not for the Tab Theme. Is that the issue you are having?
For the Tab Theme here is how to get the side panel to open at start:
in the file: \themes\TabTheme\widgets\SidebarController\widget.js
make this one change on about line 61
This maximizes the side panel at startup. Not sure how to tell it what widget to open first, but if you put the one you want open at the top then it will load in first.
-Stan