-
-
Notifications
You must be signed in to change notification settings - Fork 49k
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
Add onFilter property to Table that gives access to the filtered dataSource #10898
Conversation
Deploy preview for ant-design ready! Built with commit 0a7f7b3 |
Codecov Report
@@ Coverage Diff @@
## feature-3.7.0 #10898 +/- ##
=================================================
+ Coverage 91.74% 91.74% +<.01%
=================================================
Files 196 196
Lines 4892 4895 +3
Branches 1369 1370 +1
=================================================
+ Hits 4488 4491 +3
Misses 400 400
Partials 4 4
Continue to review full report at Codecov.
|
I think it is better to add |
I agree it would be a cleaner approach. I'll change it so the |
I moved the filteredDataSource to the After looking around I found that the filters get removed in the Why do the filters get removed from the state in the ant-design/components/table/Table.tsx Lines 416 to 422 in 5ab265a
|
@tijp 这个问题后续还有进展么? |
this is prop is not available in 3.8.1v ? |
First of all, thank you for your contribution! :-)
Please makes sure that these checkboxes are checked before submitting your PR, thank you!
master
, feature for latest active branchfeature-x.x
.npm run lint
and fix those errors before submitting in order to keep consistent code style.Extra checklist:
Oops, new PR. I forgot to create a new branch so the previous PR had some mixed commits. Sorry for that, I'm still learning PR's.
Sometimes it's desirable to receive the filtered dataSource when the filters change in the
Table
component. For example when you want to display the number of rows in your table.Issue for this feature #10298
This PR adds an
onFilter
prop to theTable
component. When the filters change, theonFilter
callback will be called with thefilteredDataSource
andfilters
properties.