serverSide and select extension
serverSide and select extension

Datables 2.1.8
Select 2.1.0
I use serverSide and the select extension.
When I navigate between pages, the table reminds selected rows in each pages and the number of selected rows is correctly displayed.
Also rows().deselect() acts as expected. So I'm quit sure that the rowId are stored somewhere. That said I can't retreive them.
When I use table.rows( { selected: true } ).count();
it retrieves only le row selected on the displayed page.
How can I get the list of rowIds ?
This question has an accepted answers - jump to answer
Answers
sorry,
rows().deselect()
only acts on the active page.I update to 2.2.2 and 3.0.0 and I have the same behavior
See this example of how to get the selected row IDs across all pages.
As a side note use
rows().ids()
to get the IDs. However this will only work on the current page displayed when using server side processing.Kevin
Select 3 has a new
select.cumulative()
method for accessing that information (source code). Annoyingly, I don't appear to have written docs for it! I'd swear that I did - I remember doing it, but I can't see them...!I'll need to redo that - sorry. Server-side processing with Select can be a bit tricky, particularly when considering select all and then starting to remove items!
Allan
thank you both. select.cumulative() will do just fine.
What about an unselect.cumulative() ?
Are you asking for a way to deselect all the rows when using server side processing? If yes then see this thread. Not sure if the API plugin I created is the best way. @allan will let us know
Kevin
is:
acceptable ?
In my case it seems to be enough
oups, sorry, I should have read your suggestion first
Yes, either your plugin or Kevin's
select.deselectAll()
looks like a decent way to do it at the moment. Frustrating that I didn't think about that behaviour as a requirement. I'll implement a suitable function in Select.Allan