Closed LokeshBoran closed 6 years ago
I am also facing a similar issue if there is any solution Please let me know.
@hjalmers still there is the issue. I updated the example with the latest build still I am able to reproduce the same issue.
Hey, @hjalmers d5ab4f7 there is serious issues occurs.
selectedRows
every time when i click on select/deselect all checkbox.@LokeshBoran, I haven’t published a new version containing the fix yet so you you have to hang tight a little while longer. I’ll open this issue again until it’s published though:)
@LokeshBoran the fix is now available with version 4.15.0. Please note however that it's a bit hard for the table to know the state of each row when it's loaded from the server. I'd probably suggest adding a property on each row and store the state on the server with the rest of the data if you want to persist the state. If you enable caching like I've done in this example it will work (not the select all option for data that hasn't been loaded yet though).
The problem with caching is that if the data on the server changes the table won't update when you paginate between pages that has already been loaded/cached. If caching is disabled on the other hand, the table will request new data when you go to a new page and the rows will get new row ids at the same time, that's also the reason why the state is not persisted.
We could keep the ids and just update the data but what if a new row has been added on the server and/or the order has changed? We can't just rely on row or page indexes to keep the states in sync when the records are fetched from the server and without a unique id it's very hard to sync a local record with a record received from the server. I've added the ability to set a custom row id #245 which simplifies syncing state with server as well.
@hjalmers thanks a lot for your changes. Looking forward to seeing more changes related to usability and stability of the library. And yes if I want to deselect checkbox on page-change than on gt-page-changed-lazy event I have to call deselectAllRows method.
No problem, yeah there are some manual steps involved now like deselecting rows if data set is replaced etc. I was also thinking about what should happen if you've checked "check all" and you go to the next page, the server will fetch data from the sever and I guess it should select them if they're not already selected otherwise the state of the select all checkbox won't be correct.
I think there is an issue with Lazy Loading and Checkbox Selection method. If I combine both the examples checkbox selection is not working properly and sometimes paging is also not visible. I am sharing an live example for the same problem - example
Step-1
If you find any solution plz let me know. Thanks in advance. :)