Unexpected behaviour in Datatables Select Extension
Unexpected behaviour in Datatables Select Extension
An unexpected behaviour is visible in this example.
The select style of the example is 'Os' thus selecting a row would deselect the previous rows.
Try selecting 4 rows from page 1, then select another row from page 2 (without CTRL or SHIFT clicking). The table now displays the total number of rows selected to 5, when this should have reset to 1 row selected. The table seems to accumulate selected rows between pages, even tough the table has an 'Os' style of selection.
Also, clicking "Deselect All" while on page 2 only deselects the rows of the current page and not of the entire table. Thus the table now displays the total number of rows selected to 4, instead of 0 rows selected.
Answers
Actually no - the whole point of that specific example is to demonstrate the new server-side processing support in Select 2.1 whereby it can select rows over multiple pages. You need to use
select.cumulative()
to get the list of row ids though, since.rows({selected: true})
can only select for the current page.If you want the old behaviour, perhaps what I need is an option to make the info show only the current page selected row count?
Allan
Hi allan, Thanks for the reply.
I would have thought that selecting rows over different pages (server side processing or not) would have been only possible with 'multi' or 'os' CTRL/SHIFT clicking.
It is out of scope that you are able to select rows across different pages with 'single' or 'os' click selection. In my opinion, the current behaviour would have been better as separate option.
And what about the 'Deselect All', Is there a way to clear ALL rows selected in a server side processing environment?