Hi,
did anyone build or find a solution for changing a listitem's parent and sublayers' visible when it is clicked in layerlist widget?
thank you.
I'm not quite sure what you're trying to do, but each ListItem has a reference to its parent and children you can interact with. This demo does that.
https://codepen.io/odoe/pen/ExXJKya?editors=1000
Hi,Thanks for your reply. When a listitem's visibile is changed to true, it has looped to walk through the parent setting visible attribute to true,but as the same time, I want to set it's all children's visible attribute to true. How to do this?
In that sample you can just loop through the children and set their visibility too.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.