[x] React Grid
I have a table of employees with row data coming in through the props like this:
<Grid rows={this.props.tableData} columns={columns}> ..... </Grid>
The grid is using selection plugin and the selection array returns only the row id in the form of an integer. I am trying to get the row data for the rows that are selected and do some further processing on that data. How can I get the row data for all the selected rows? I have not specified any particular id for the tableData and it generates the integer on its own.
Hi,
聽
In your case, you should define an ID for each data item and pass a function that returns this ID to the Grid component's聽getRowId聽property as shown in the following example.
The selected row IDs are available via the SelectionState plugin's selection property.
Hi,
Thank you for this. It was really helpful, I did end up modifying this a little by handling the changeSelection in the component that wraps the table component.
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests.
Most helpful comment
Hi,
Thank you for this. It was really helpful, I did end up modifying this a little by handling the
changeSelectionin the component that wraps the table component.