I have a list which consists of checkboxes. My requirement is based on another array called options. My option array has 3 elements and for the first option all the checkboxes should be available, so I can check them based on my requirement. But for the remaining 2 options I have to disable a few checkboxes based on their Id's.
if(event.value == 5){
var opt = this.state.checkoxesArray
{
opt = opt.map((obj) =>
{
if(obj.id === 1 || obj.id === 4 || obj.id === 6)
{
obj.disable = true;
}
return obj;
}
This is how I disabled for my remaining 2 options. Here as of now I am unable to check a few checkboxes for value '5'. But I want to grey it out or remove them, for 2 options and enable all these for 1 option.
I am new to react. Thanks in advance.
Top comments (0)