1.9 Pagination - TR custom class/attributes disappear after 1st page
1.9 Pagination - TR custom class/attributes disappear after 1st page
I'm applying a custom class to the TR elements in a data table with the pagination option turned on and I'm finding the class I applied is only showing up on the 1st page. So I tried a custom attribute and same thing - only on the first page. On initial apply I verified that .dataTable().fnAddData({...}) is getting called for all rows in the table and on the call is setting the element correctly.
It seems that the only class applied on the last page is the odd/even class:
First page:
<tr class="odd unread" data-ru="unread">
Last page:
<tr class="odd">
The custom class/attribute on the 1st page persist if I switch to the last page and back so it isn't something happening on the page event.
Options:
var dtOptions = {
"sDom": '<"top"f>rt<"modal-footer"lip><"clear">',
"aoColumnDefs": [{
"bSortable": false,
"aTargets": [0]
}],
"bAutoWidth": false,
};
Answers
Ok, have a workaround for now but it is somewhat hacky: