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
Can't override <Table/> "Select All" checkbox when paginated #25747
Comments
Dear Team I guess I got this problem , I've readed the code , there are two props in Thx & Best Regards |
In my memory, SELECTION_ALL is trigger by a dropdown menu. Header checkbox alway reflects pageData |
Yes U R right , I need to read it careful |
Maybe you can add a |
Yes I have the same issue... as @07akioni mentioned, a getHeaderCheckboxProps would solbe the problem I guess. Since I cant controll the check all checkbox state, I am gonna have to use another component rather than the Table one with a controlled checkbox |
I found this workaround where you can override the check all checkbox using the |
Gahh I should have thought of that! Cheers! |
Reproduction link
Steps to reproduce
I have an Ant Design table with sorting, selection and pagination. By default (if I understand it correctly), Antd Table selection works on a per-page basis. If you click the 'Select All' checkbox in the selection column header, Antd will select all the rows on the current page but if you then change page, both the rows and header will revert to a unchecked state. The selection is not lost because if you then go back to the previous page, the rows and header are all checked.
So I wanted to change this so that 'Select All' really selects all the rows of the table regardless of pagination. I found a few github issues in which recommended simply managing the selectedRowKeys array onSelect and onSelectAll functions oneself. I did this and now my selection works as expected...
However...
The "select all" checkbox in the selection column header still functions in terms of the page rows. So for example if I'm on the first page and "Select all" then deselect one of the rows, the "select all" checkbox is in the intermediate/partial state as expected. However if I then go to the next page, all rows are checked as expected and so is the "select all" checkbox in the header. For this selection to make sense functionally it would need to remain in the intermediate/partial state. It needs to reflect the selection over the entire dataset and not just the current page.
What is expected?
To be able to override the state of the "Select all" checkbox to find a "selection over entire paginated dataset" scenario.
What is actually happening?
Nothing. Can't find any info on how to do this!
This is a bit of a deal-breaker for us...
The text was updated successfully, but these errors were encountered: