Modify TD in only rows that are visible due to pagination
Modify TD in only rows that are visible due to pagination
I have tried to piece together the various options to accomplish this but I cannot get past modifying all rows.
I have a check box in column (0), 12 rows, and Show set to (10).
I want to check the checkbox for only the 10 rows that are visible.
Here is what I am currently doing:
[code]oTable.$('input', {filter:'applied'}).prop( 'checked', true);[/code]
I need to get this selection down to only the visible rows. It works when filters are applied obviously, but how do I select only the rows visible due to pagination.
Thanks.
I have a check box in column (0), 12 rows, and Show set to (10).
I want to check the checkbox for only the 10 rows that are visible.
Here is what I am currently doing:
[code]oTable.$('input', {filter:'applied'}).prop( 'checked', true);[/code]
I need to get this selection down to only the visible rows. It works when filters are applied obviously, but how do I select only the rows visible due to pagination.
Thanks.
This discussion has been closed.
Replies
[code] var data = oTable._('tr', {filter: 'applied'});[/code]
as well but the array still included all rows since there were no filters applied, just the pagination set to 10
I had to select the actual table in the dom and not the datatable....
[code]
oTable.$('input', {page:'current'}).prop( 'checked', true);
[/code]
Doc for the options here: http://datatables.net/docs/DataTables/1.9.4/#$ . This will be much better documented for 1.10, the documentation for which I've been working on recently.
Allan