Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82042

Add Class to new row using scroller plug-in

$
0
0
I tried using what Allan suggested on this post, http://www.datatables.net/forums/discussion/181/fnadddata-and-add-class/p1
var newRowAdding = groupTable.fnAddData([
	userData[0],
	userData[1],
	userData[2],
	userData[3]
]);
var newRow = groupTable.fnSettings().aoData[ newRowAdding[0] ].nTr;
if ($(this).hasClass('changed')) {
	newRow.setAttribute('class', '');
} else {
	newRow.setAttribute('class', 'changed');
}

This works, but only so long as the row being added is currently in the scroller view (which make sense since it is merely looking for the latest row added to the DOM). Is there something else I can do to add a class to a row?

Viewing all articles
Browse latest Browse all 82042

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>