This is a little bit of a non-trivial problem - not insurmountable of course, but there are details that need to be considered. The main thing to note is that when you have server-side processing enabled, rows only exist for the life time of a single draw (since the data is at the server, not the client) - and a single draw when using Scroller is just the visible part of the table ( http://datatables.net/blog/Introducing_Scroller_-_Virtual_Scrolling_for_DataTables ).
So what is happening is that when you move Scroller to a different part of the table, the nodes that you had before are destroyed and the new required ones created. This since most of my demos just use classes on the nodes to indicate what rows are selected, this information is lost.
So what must be found is another way to store this information and to apply it on each draw. Typically the method I use is to keep a Javascript array with the IDs of all the rows in the table that are selected (use the DT_RowId option), and remove them from this array when needed. Thus when the table is redrawn, the rows can be marked as visually selected again.
I have an example that shows how this can be done here: http://datatables.net/release-datatables/examples/server_side/select_rows.html . This method will work with Scroller as well, since Scroller just just uses the pagination feature of DataTables :-)
Replies
So what is happening is that when you move Scroller to a different part of the table, the nodes that you had before are destroyed and the new required ones created. This since most of my demos just use classes on the nodes to indicate what rows are selected, this information is lost.
So what must be found is another way to store this information and to apply it on each draw. Typically the method I use is to keep a Javascript array with the IDs of all the rows in the table that are selected (use the DT_RowId option), and remove them from this array when needed. Thus when the table is redrawn, the rows can be marked as visually selected again.
I have an example that shows how this can be done here: http://datatables.net/release-datatables/examples/server_side/select_rows.html . This method will work with Scroller as well, since Scroller just just uses the pagination feature of DataTables :-)
Regards,
Allan