Dear All,
I noticed that in lizmap 3.8 the group collapse is not longer controlled by javascript as texted here:
Deprecated since LWC 3.7
- Group collapse, use a QGIS theme and the checkbox at the “Layers” tab in the plugin
Can Anyone explain me how is now possible to do the same think?
Thanks
Hi,
As described, this is now completely specified via the QGIS themes.
You can collapse all groups in QGIS and then create a corresponding theme.
Or open individual groups (or legends) and save this as a new theme.
This is very flexible. It works perfectly. Only for sub-groups there is still a bug at the moment.

You can also use extensions such as ThemeSelector for the themes
The option to use the first map theme (alphabetical) must then be activated in the Lizmap plugin.
If you still want to do it by Javascript you can :
Fold all groups :
document.getElementById('layers-fold-all').click();
Or fold a specific group :
document.querySelector("[data-testid='Group name'] .expandable").click();