-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Table checkbox selection ignores filtering #5220
Comments
+1 |
Having the exact same issue. |
You would have to keep track of the current filters selected with |
I'm having a similar issue. When I check the p-tableHeaderCheckbox I get all on page (in my case 20) and next i nav through pages I can select one off items and it adds to my total number of selected items. However as soon as I check the select all on page again it blows away my selected items and shows me only those 20. Same thing if i select all on page 1, go to page 2 and select all again...page 1 stuff is gone. |
Same behavioral issues here ... totally confusing feature if it does not work fully integrated with paging and filters. |
Anyone confirmed this in 5.2.4? The select all checkbox is now not responding for me. |
it's fixed in 5.2.4 |
after filtering and select all with checkbox you cannot deselect all with the checkbox again |
In 5.2.4 the behavior appears to be different depending on if However, I am using the deprecated datatable: https://www.primefaces.org/primeng/#/datatable/selection |
What should be the behaviour for the following situation :
|
the 2 hidden rows not selected |
@chfiras p-table keep the selection, no matter what is filtered |
In that case the 4 rows should remain selected as you took no extra action.
|
So the p-table doesn't actually maintain the selection if applied AFTER select all is selected, only before. Select all now works and respects filtering if used after filter, however I there is now a second (expected) feature for filtering to respect select all. There is also another bug associated here. Check box is disabled, following a select all on a filtered collection.
|
I handled it using this.dataSource.filteredData instead of this.dataSource.data. |
**I'm submitting a ...
Current behavior
If you use table selection (https://www.primefaces.org/primeng/#/table/selection) and have a checkbox header to select all (p-tableHeaderCheckbox), selecting all will include filtered out rows and rows from other pages.
Expected behavior
When you select all, it shouldn't include in the selected data array, data that has been filtered out or is on another page. It should only select what's visible on the screen.
Minimal reproduction of the problem with instructions
Create a table with two pages of data and a basic filter and multi row selection with checkboxes as per the docs. Note that when you select all, items you have filtered out or are on another page are included in the selection.
What is the motivation / use case for changing the behavior?
It's the logical expected behaviour, only to select what you can see.
Angular version: 5.2.6
PrimeNG version: 5.2.0
Browser: all
Language: [all]
The text was updated successfully, but these errors were encountered: