Why is _fnRowDeselectAll called when paging?
Why is _fnRowDeselectAll called when paging?
praeter
Posts: 3Questions: 0Answers: 0
We have a table using DataTables and TableTools, getting each page of data from the server. If we select items on one page, then goto another page, the items selected on the first page are no longer selected. I'm trying to implement this in a fairly straightforward way - update an array with info about the selections/deselections using fnRowSelected and fnRowDeselected.
It works fine, with one crucial exception - every time I goto another page, _fnRowDeselectAll is called, which loops through the built-in collection of selected objects (this.s.select.selected), calling _fnRowDeselect on each one, effectively undoing my selections.
Is this the default behavior? Why? Is it possible to override? If I could just tell DataTables/TableTools to not do this on each page change, I'd nearly be done with my task.
It works fine, with one crucial exception - every time I goto another page, _fnRowDeselectAll is called, which loops through the built-in collection of selected objects (this.s.select.selected), calling _fnRowDeselect on each one, effectively undoing my selections.
Is this the default behavior? Why? Is it possible to override? If I could just tell DataTables/TableTools to not do this on each page change, I'd nearly be done with my task.
This discussion has been closed.
Replies
Thanks,
Allan
I'm not sure why _fnRowDeselect would have been getting called in that way - it sounds like an error. It was this commit that removed that internal function - https://github.com/DataTables/TableTools/commit/2a166491c29c4e42b2304990b519ca2c75584069, which was part of a considerable overhaul of the row selection since it was rather lacking.
TableTools' row selection is being used on this page, and you'll be able to see that row selection is retained in the current release: http://editor.datatables.net/release/DataTables/extras/Editor/examples/index.html . So hopefully this is fixed in the latest version, but if not, we'd need a test case.
Allan