After sorting by clicking a column, is there a way to access the new sorted table, or in particular the order of the items in a particular row?
Isn't the array itself manipulated? In such case, wouldn't you be able to access the new array in the render method? Or do you mean inside the component itself?
I tried printing out the values in the table in the render method. It
doesn't appear that the reorganization of the table by clicking on the
column triggers the render method....
ᐧ
On Mon, Jun 19, 2017 at 1:24 AM, cbll notifications@github.com wrote:
Isn't the array itself manipulated? In such case, wouldn't you be able to
access the new array in the render method? Or do you mean inside the
component itself?—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/tannerlinsley/react-table/issues/350#issuecomment-309372111,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANiP1pnUglWRZF9WE10uJn1-HtgsQrQoks5sFjAtgaJpZM4N9iwD
.
You need to use a ref like so:
<ReactTable ref={instance => this.tableInstance = instance} />
// ... somewhere in your parent component
console.log(this.tableInstance.getResolvedState().sortedData) // log the sorted+filtered row model
I believe that is the array you are looking for. :)
Closing for triage.
Most helpful comment
You need to use a
reflike so:I believe that is the array you are looking for. :)
Closing for triage.