tleunen / react-mdl

React Components for Material Design Lite
https://tleunen.github.io/react-mdl/
MIT License
1.76k stars 255 forks source link

[DataTable] onSelectionChanged return rows, what about row object id? #346

Closed xdvarpunen closed 8 years ago

xdvarpunen commented 8 years ago

Hi,

DataTable onSelectionChanged returns row number. In order to create database queries one wants to get id of the object in the row, not the row id. Is there way to get row object id in DataTable/access DataTable row object?

-XDVarpunen

xdvarpunen commented 8 years ago

Found it; rowKeyColumn attribute sets row id equivalent to assigned object id

tleunen commented 8 years ago

The value inside the array can be 3 things, in this order:

So if you set a rowKeyColumn, which is suggested, it will use that :)