0

I have a react-data-grid where each cell contains a checkbox and each column name has a check box beside it. When I click the checkbox beside the column name I want to check all of the checkboxes that correspond to that column. Is this possible?

let finalNotifications = [];
 finalNotifications.push({
                Domain: "Domain Name",
                Types: "Type Name",
                Email: <input type={"checkbox"}/>,
                Text: <input type={"checkbox"}/>,
                Phone: <input type={"checkbox"}/>
            })
const detailColumns = [
{key: "Domain", name: "Domain"},
{key: 'Types', name: 'Message Name'},
{key: 'Email', name: <div>Email <input type={"checkbox"} onClick={}/></div>},
{key: 'Text', name:  <div>Text <input type={"checkbox"} onClick={}/></div>},
{key: 'Phone', name:  <div>Phone <input type={"checkbox"} onClick={}/></div>}

];

this.setState({notifications: finalNotifications});
notificationRows = this.state.notifications;


<ReactDataGrid
    title={false}
    columns={detailColumns}
    rowGetter={i => notificationRows[i]}
    rowsCount={5}
    minHeight={150}/>;

1 Answers1

0

You should check out their documentation. This should help. https://adazzle.github.io/react-data-grid/docs/examples/row-selection

Liam
  • 48
  • 5