Skip to content

Return filtered and searched data only #1365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Mikeez opened this issue May 4, 2020 · 3 comments
Closed

Return filtered and searched data only #1365

Mikeez opened this issue May 4, 2020 · 3 comments
Assignees

Comments

@Mikeez
Copy link

Mikeez commented May 4, 2020

Question
I am using ToolkitProvider and BootstrapTable and I have column filtering and a global search. How can I get the filtered data after searching and filtering?

I want to set the filtered data to a new state to be able to export for PDF.

I tried:

Using the option in BootstrapTable and having a callback function, did not work.
I used the onFiltering and I tried to setState
Is there a more efficient way, I read the documentation concerning the filtering. Nothing jumps out to me

@Mikeez
Copy link
Author

Mikeez commented May 12, 2020

I read a lot of people were able to go around this, any suggestion?

@AllenFang
Copy link
Member

@Mikeez for column filter, we got afterFilter, here is an online example.

However, for the searching, we don't have this function yet. However, there's another solution is using the exposed API but it's not a listener solution.

Anyway, I will implement a afterSearch hook for u, thanks

@AllenFang
Copy link
Member

Please upgrade packages to newest and you will have afterSearch.

https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/search-props.html#searchaftersearch-function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants