fnRowCallback and IE8

fnRowCallback and IE8

geoffgeoff Posts: 2Questions: 0Answers: 0
edited April 2010 in General
I'm using fnRowCallback to add onmouseover, onmouseout and onclick events to rows in a DataTables table. This works fine in Firefox, but in IE the callbacks never fire. I've checked the code in IE's developer tools, and the callback declarations are correctly inserted into the DOM, and if I take the generated code and view that in IE it works (ie, copy/paste the generated table source into a separate HTML doc).

Does anyone have any ideas why IE is behaving in this way?

Here's the DataTables / event callback code I'm using...

[code]

function ChangeColor(tableRow, highLight) {
if (highLight) {
tableRow.style.backgroundColor = '#dcfac9';
}
else {
tableRow.style.backgroundColor = 'white';
}
}
function DoNav(theUrl) {
document.location.href = theUrl;
}

...

$(document).ready(function(){
oTable = $("#assettable").dataTable( {
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
url = "DoNav('/objects/" + aData[6] + "/');";
$(nRow).attr({"onmouseover":"ChangeColor(this, true);", "onmouseout":"ChangeColor(this, false);", "onclick": url});
return nRow;
},

"bAutoWidth" : false,
"aoColumns" : [
{ "sWidth" : "90px" },
{ "sWidth" : "190px" },
{ "sWidth" : "95px" },
{ "sWidth" : "85px" },
{ "sWidth" : "270px" },
{ "sWidth" : "70px" },
{ "bVisible": false }
],
"bProcessing": true,
"bServerSide": true,
"bSortClasses": false,
"sPaginationType": "full_numbers",
"iDisplayLength": 20,
"sDom": 'rt<"bottom"ip<"clear">',
"sAjaxSource": "/ajax/objectlist/",
"fnServerData": function ( eSource, aoData, fnCallback ) {
$.getJSON(eSource, aoData, function(json) {
fnCallback(json);
});
}
});
[/code]

Replies

  • geoffgeoff Posts: 2Questions: 0Answers: 0
    With a little brain activity and research, I've answered my own question - using jquery live events to handle the required actions.
This discussion has been closed.