How to get the checked checkboxs' positions in CheckboxGroup?

Hi,I need add a lot of checkboxs into the instance of class that named “CheckboxGroup”,how can i get checked checkboxs’ position in this group after that.
Thank you for help me.

Hello and welcome!

Can you repro your issue in the Playground? This will help understand what do you mean with position :slight_smile: (like order, coordinates?)

I wanna to get the indeices of checked checkbox in checkboxGroup,because when the checkedState changed,the checkbox in the checkboxGroup only reply once.
just like this:
checkboxGroup.addCheckbox(${checkboxname},(s)=>{
if(s==false){
newlayer.modelContainer.removeAllFromScene();
}
// if(s==true){
// newlayer.modelContainer.addAllToScene();
// }
},true);
Where “if(s==true)” doesn’t work correctly,that means the checkbox in this group never listen the event of changing checkstate after my first clicking.

I think that would be better with adding a checkbox instance into checkboxGroup instead of using parameters.

As suggested

It is nearly impossible to see the solution without one.

1 Like