Highlighting Rows
Highlighting Rows
manesh.mistry
Posts: 4Questions: 0Answers: 0
I have loaded the DataTable with Json Data but when I go to try and highlight the rows using your
$('#example tbody td').hover(function() { .. script,
the 'td' selector does not seem to be recognised. It is recognised with $('#example tbody').hover(function() but that is not much use when I want to highlight the row.
Do you have another script for this scenario?
$('#example tbody td').hover(function() { .. script,
the 'td' selector does not seem to be recognised. It is recognised with $('#example tbody').hover(function() but that is not much use when I want to highlight the row.
Do you have another script for this scenario?
This discussion has been closed.
Replies
Use this,
$('tbody tr').hover(function () {
this.style.bachgroundcolor: '#cccccc';
});
IDProduct
IDProduct
Have you tried creating css definition instead?
e.g.
#example tbody td:hover {
color: #cccccc;
}
something like that.
codingavenue
[code]
$('#example tbody td').live('hover', function() {
//do something....
});
[/code]
codingavenue
[code]
$("tbody tr").live("mouseover", function(){
$(this).children().addClass("highlighted");
});
$("tbody tr").live("mouseout", function(){
$(this).children().removeClass("highlighted");
});
[/code]
Gregor