Devextreme-reactive: [QUESTION] Get row data for selected rows in React Grid

Created on 21 Jul 2018  路  3Comments  路  Source: DevExpress/devextreme-reactive

  • [x] I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

  • [x] React Grid

    QUESTION:

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.

Grid question

Most helpful comment

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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sintuchintu picture sintuchintu  路  3Comments

franklixuefei picture franklixuefei  路  3Comments

SferaDev picture SferaDev  路  3Comments

slava-lu picture slava-lu  路  3Comments

madebymt picture madebymt  路  3Comments