row highlighting based on value
row highlighting based on value
ducati1212
Posts: 2Questions: 0Answers: 0
I added a simple line under document .ready to highlight rows based on value returned from my query
$(document).ready(function() {
$('#example').dataTable();
$('tr').find('td:eq(6):contains(null)').parent().css('backgroundColor', 'yellow'); // this does row higlingting broke right now
} );
This code works except for paging. So when I go to page 2 of my results highlighting does not happen? Is there an easier way to highlight rows based on a value. the code is just PHP
$(document).ready(function() {
$('#example').dataTable();
$('tr').find('td:eq(6):contains(null)').parent().css('backgroundColor', 'yellow'); // this does row higlingting broke right now
} );
This code works except for paging. So when I go to page 2 of my results highlighting does not happen? Is there an easier way to highlight rows based on a value. the code is just PHP
This discussion has been closed.
Replies
Try something like this:
[code]
$(document).ready(function() {
$('table#example')
.find("tr").find('td:eq(6):contains(null)').parent().css('backgroundColor', 'yellow') // row higlingting
.dataTable();
});
[/code]
Thanks
That's right, the semicolon after the 4. line was wrong, I've corrected it.