Check parent checkbox when checking child checkbox in laylerlist widget with groups of layers

1185
2
03-15-2017 01:06 PM
GilbertoMatos
Occasional Contributor II

Hello

Is there any way that after the user clicks a child checkbox, the parent checkbox is also flagged? I created the groups of layers in the layerlist widget, using a featurecollection, and if I just check the child checkbox, without checking the parent checkbox, the layer is not displayed on the map.

Thank you!
Gilberto.

0 Kudos
2 Replies
GilbertoMatos
Occasional Contributor II

Hello

Thanks for your suggestion. Your layerlist widget looks pretty good. What happens is that I already have a layerlist custom widget, so what I need is just to make the group checkbox, that is, the father of what I checked, also be checked.

I set up groups manually using featurecollection. Before your suggestion, I tried using the "layerInfo.setTopLayerVisible (true);" statement, but I did not succeed. I did this within the "_onCkSelectNodeClick" function of the "LayerListView.js" file.

Attached, I'm including my layerlist widget. If you can take a look, I thank you.

Thank you!
Gilberto.

0 Kudos