class CheckList extends React.Component {
state = {
checkedList: [],
indeterminate: false,
checkAll: false
};
OnChange= (checkedList) => {
// console.log(this.props.dataitem.action.length);
console.log(checkedList);
this.setState({
checkedList,
indeterminate: !!checkedList.length && (checkedList.length
checkAll: checkedList.length === this.props.dataitem.action.length
});
}
OnCheckAllChange= (e) => {
this.setState({
checkedList: e.target.checked
? this.props.dataitem.action.map((item, key) => {
return item.value;
})
: [],
indeterminate: false,
checkAll: e.target.checked
});
}
render() {
const dataitem = this.props.dataitem;
return (
marginBottom: '1em'
}}>
{dataitem.title}{dataitem.action.length}