Checkbox select all not working properly with server-side pagination
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Using server side pagination and checkbox selection:
- go to page 1, select some items
- got to another page, push the “select all” checkbox
Current behavior
- it will select only the elements in the new page, removing the selection of the previous page
Expected behavior
- all the elements of the new page should be added to the selection, without removing the previously selected items
Reproduction of the problem
The reproduction steps are listed above.
Also, I need to specify that this is NOT related with https://github.com/swimlane/ngx-datatable/issues/874 , since I set the [rowIdentity]
function and the single selection works fine even across different pages (except for the “select all” button).
Please tell us about your environment:
Angular CLI: 1.7.3
Node: 8.9.1
OS: linux x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.7.3
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.6.2
webpack: 3.11.0
-
Table version: 0.8.x
-
Angular version: 5.2.9
-
Browser: Google Chrome 65.0.3325.181 (Official Build) (64-bit)
-
Language: TypeScript 2.6.2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:14
Top Results From Across the Web
Checkbox selection not working when using server-side ...
I'm using ngx-datatable from Swilane in my Angular 5+ app with the server-side paging.
Read more >Select All Functionality Fails While Appying Pagination in Grid ...
I m having a grid view , Which has where each row has a checkbox to check the rows item in the html...
Read more >Error Saving Selected Checkbox on Datatables Server Side
im using his library but i dont know why whenever i select one of the check boxes. it selecting all checkboxes when im...
Read more >"Select All" with Remote Paging | Infragistics Forums
Unfortunately selection is not stored in the Data Source (neither on the client nor on the server side). You could however select/deselect a...
Read more >Retain Checkbox Selection with Server Paging - Telerik
How can I retain the selection of checkbox in the KendoReact Grid when I navigate across different pages when the data comes from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found a solution using custom checkboxes, and custom select all function. And an object that stores which pages has selected all.
Custom checkbox column taken from http://swimlane.github.io/ngx-datatable/#chkbox-selection-template Here i removed let-allRowsSelected=“allRowsSelected” let-selectFn=“selectFn” From template, and hooked up my own checkbox function.
With this select all function (CompanyListPaginated are my rows, for the page)
Remember to remove selectAll page index when unselecting a single item.
However i really wished i didnt have to handle this manually. One of the reasons i chose ngx datatable is that I wanted to avoid making custom select/select all functions.
Thanks for your answer here I’m confused that what is selectAllOnPage & pageOffset in this code and also I’m facing one more issue that if I click on select all checkbox then when I’m hovering on list then my records are getting selected otherwise my records are not getting selected can you please help me