react-multi-select-checkbox
react-multi-select-checkbox copied to clipboard
Example of Multiple Checkbox Check functionality In React JS. To Solve the Complex checkbox Component Issue.
Multiple checkbox handling by React JS
React is most popular front end development framework. For our application development purpose we have build different complex web component to fullfill business requirment. Multiple checkbox selection is important UI feature for standard front end development. Today i have provide you some example about multiple checkbox selection with react js using the state of react js.
Installation and Prerequisites
- You need to Install
create-react-apppackage globally by this commandnpm install -g create-react-app (npm command). - Download or Clone the Project from
https://github.com/tariqulislam/react-multi-select-checkbox.git. - Run command on
terminalorcmdnpm installoryarn install. - Then Run command
npm startoryarn start
Available functions to access Parent and Chield Checkbox Component
- To Access Parent Checkbox Component
onChangeevent, example code
filehandleAllChecked = (event) => {
let fruites = this.state.fruites
fruites.forEach(fruite => fruite.isChecked = event.target.checked)
this.setState({fruites: fruites})
}
- To Access Chield Checkbox Component
onChangeevent, example code
handleCheckChieldElement = (event) => {
let fruites = this.state.fruites
fruites.forEach(fruite => {
if (fruite.value === event.target.value)
fruite.isChecked = event.target.checked
})
this.setState({fruites: fruites})
}
Licences
All the Code and information of this repository free to access. This will be licence under MIT. User can modified it and share it and if he/she want to contribute it, Feel to free to contribue.