question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

checkbox selected with server pagination

See original GitHub issue

I’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

Current behavior cant see checked checkbox after server pagination.

Expected behavior On pagination we expect to see the selected rows. (Server Pagination)

Reproduction of the problem We use server pagination, Select any row Move on to the next page (server) Select another one Go back to the first page – The expected selected row is not selected.

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Table version: 9.3.1
  • Angular version: 4.0.x
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

49reactions
tylersampsoncommented, Sep 14, 2017

The issue, I assume, is because new objects are loaded for every page change. So when the selected items are compared to the page, there is technically no match.

For me I managed to solve this by using rowIdentity so that it will compare the “id” field of my data instead of the object. https://swimlane.gitbooks.io/ngx-datatable/api/table/inputs.html#rowidentity

<ngx-datatable
    ...
    [rowIdentity]="getId">
getId(row) {    
    return row.id;
}

Hope this helps

3reactions
ghostcommented, Apr 19, 2018

not working for. can any one provide with demo and server paging?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Retain Checkbox Selection with Server Paging - Telerik
An example on how to retain checkbox selection in the KendoReact Grid with server paging.
Read more >
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 >
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 >
Master toggle checkbox on table with server-side pagination
Maybe better ways to handle this but the way I handle it is when I get my data back I loop through it...
Read more >
Paging through gridview clears selected checkboxes - MSDN
You have to save Checkbox state on server side so that when you come back to that page, you see expected results. Friday,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found