React-table: Access filtered result data.

Created on 31 May 2017  Â·  6Comments  Â·  Source: tannerlinsley/react-table

Hi,

I want to access the data returned from the filtered result. I'm trying with onfileredChange and defaultfilterMethod, but I'm only able to get all the data present in the table instead of just the search result.

Any suggestions are appreciated!!
Thanks.

Most helpful comment

This.tableInstance.getResolvedState().sotedData
On Fri, Jun 2, 2017 at 12:44 PM kirank3836 notifications@github.com wrote:

I'm using the ref, but not sure how to grab the sortedData. Can you please
gimme an example of what exactly you mean?

ref={el=> this.tableInstance = el}

Thank you,

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/tannerlinsley/react-table/issues/310#issuecomment-305877709,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFUmCTDqk0jWJP0Kdo8pSevYGV7dmNC-ks5sAFf0gaJpZM4NrmD0
.

All 6 comments

Here's an example that uses the filtered results from onFilteredChange:

https://react-table.js.org/#/story/controlled-component

If you're still having issues post the code you have so we can take a look.

Thanks for the response. But that's returning the filter input value right. I want to access the updated results in table after filter.

Ah. In that case you'll probably need to save a ref to the table. And then in onFilteredChange you'll want to grab the sortedData state from the table.

I'm using the ref, but not sure how to grab the sortedData. Can you please gimme an example of what exactly you mean?

ref={el=> this.tableInstance = el}

Thank you,

This.tableInstance.getResolvedState().sotedData
On Fri, Jun 2, 2017 at 12:44 PM kirank3836 notifications@github.com wrote:

I'm using the ref, but not sure how to grab the sortedData. Can you please
gimme an example of what exactly you mean?

ref={el=> this.tableInstance = el}

Thank you,

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/tannerlinsley/react-table/issues/310#issuecomment-305877709,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFUmCTDqk0jWJP0Kdo8pSevYGV7dmNC-ks5sAFf0gaJpZM4NrmD0
.

Thanks a lot @tannerlinsley @aaronschwartz

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LeonHex picture LeonHex  Â·  3Comments

monarajhans picture monarajhans  Â·  3Comments

dilipsundarraj1 picture dilipsundarraj1  Â·  3Comments

dwjft picture dwjft  Â·  3Comments

pasichnyk picture pasichnyk  Â·  3Comments