How to get cell data from selected columns with a paginated page and colreorder.
How to get cell data from selected columns with a paginated page and colreorder.
I need to build an array of 'types' in jQuery.
The types I need to populated the array are included in a datatable column, I only want to add the selected row's 'types' to the array.
If this wasn't a paginated page I could loop through all the table rows with .selected class, however, because it is this will only get the selected rows for the page you are on, missing the rest on the other pages.
I can't use table.rows( '.selected' ) because this means I need to get the data by array index, but as I am also using colReorder, this index moves around.
I can't add and remove to the array as and when the .tr is clicked because multiple rows can be deselected in one tr click.
Maybe the only way to do it is by including the type column as a non-reorderable column? But is there any other way to achieve this?
This question has an accepted answers - jump to answer
Answers
Hi @greenman123 ,
You can get all the rows on all page by using
rows()
and passing in the selector-modifier ofpage: 'all'
,Cheers,
Colin
Ahh, thanks very much!