So, I have this table with these checkboxes.
When I click on "Add Entries" the right modal is being opened.
When I click on "Done", the checkboxes should become unchecked without refreshing the page.
Can you please advise me with a solution?

class Home extends Component {
selectedApps=[];
selectedAppsObjArr=[];
state={
appList:[],
isOpen:false,
addedAppsArray:[],
}
This is the function that it's content is the input checkbox
chooseAppSelector=()=>
{
let appSelectorArray=[];
for (let application of this.state.appList)
{
appSelectorArray.push(
<tr>
**<th scope="row"><input type="checkbox" className={"appsCheckbox"} id={"appSelectorCheckbox"+application.id} onClick={()=>this.checkCheckbox(application.id, application)}/></th>**
<td>{application.product}</td>
</tr>
)
}
return appSelectorArray;
}
checkboxStatus=()=> `this one is a validation of the checkbox clicks and it works as needed`
{
`I want to change the checkboxes status in here`
}
checkCheckbox=(appId, application)=>
{
let contains=this.selectedApps.includes(appId)
if (contains==false)
{
this.selectedApps.push(appId)
this.selectedAppsObjArr.push(application)
}
else
{
let index=this.selectedApps.indexOf(appId);
this.selectedApps.splice(index,1);
let index2=this.selectedAppsObjArr.indexOf(appId)
this.selectedAppsObjArr.splice(index2,1);
}
}
sendForm = () => {
this.toggleModal(); `Closing the Modal Window`
this.addNewNetworks() ` Not important function`
this.checkboxStatus(); `the above function`
}
render (){
return (
<Table striped bordered hover> `the table component`
<thead>
<tr>
<th>#</th>
<th>App</th>
</tr>
</thead>
<tbody>
Input checkbox in "chooseAppSelector"
{this.chooseAppSelector()}
</tbody>
</Table>
`divs....`
)
Thanks in advance!!
checkboxStatusfunction. Return an event and add it to your checkboxes like this:<input type="checkbox" checked={this.state.checked} onChange={this.onChangeAction.bind(this)} />where this.state.checked = false. then call it at an appropriate time.