Check all with Checkbox

0

Eestimados, I have a grid where the top has a row where there is a checkbox to select them all, then a row below has a check to uncheck them all.

The first check of the image is to select them all, the second is to uncheck them all, and the third check is one row of the grid.

This is the code I have to mark them all, but it does not work for me, and to unmark them I do not know how to do it.

I'm working with react / redux and material check-ui

import React, {Component, PropTypes} from 'react';
import Checkbox from 'material-ui/Checkbox';

class CheckboxInput extends Component {

onCheck (e, checked) {
    this.props.input.onChange(checked);
}

render() {
    return <Checkbox
        {...this.props.input}
        checked={this.props.input.value}
        onCheck={this.onCheck.bind(this)}
      />;
    }
  }

  export default CheckboxInput;

and the call in my view.jsx I do it in the following way:

tableArbol.push(

  <Checkbox id="Selectall" name="checkbox" component={CheckboxInput} 
  type="checkbox" label="Seleccionar Todo" style={styles.customWidth}/>
);
    
asked by Rodrigo 19.06.2018 в 18:15
source

0 answers