Null error in fnOpen function
Null error in fnOpen function
Hello,
I have a datatable inside of a jqueryUI tab. It works perfectly but I have added a feature to show a hidden row (similar to the example http://www.datatables.net/examples/server_side/row_details.html). It works ok when the tab is loaded for the first time, but when the I change of tab and come back to the tab (so the content tab is loaded again with ajax) it fails when calling fnOpen() function.
I have checked that the event is called successfully and logged some variables and all of them are ok. The event I add for handling the click event is shown below and the error I see with firebug in Firefox is "b is null"
"p.createElement("tr"),e=p.createElemen... b=B(this[n.iApiIndex]);if(typeof a!= ..." in the jquery.dataTables.min.js.
I'm using jquery 1.4.2 and the jquery.dataTables.min.js 1.7.2.
Thanks.
$('.addRowButton').live('click', function(){
console.log(this); //it's ok
console.log(this.parentNode); //it's ok
console.log(this.parentNode.parentNode); //it's ok
var nTr = this.parentNode.parentNode;
if($(this).is(".close")){
$table.fnClose( nTr );
$(this).removeClass("close");
}else{
$table.fnOpen( nTr, "my test message", 'details' );
$(this).addClass("close");
}
return false;
});
I have a datatable inside of a jqueryUI tab. It works perfectly but I have added a feature to show a hidden row (similar to the example http://www.datatables.net/examples/server_side/row_details.html). It works ok when the tab is loaded for the first time, but when the I change of tab and come back to the tab (so the content tab is loaded again with ajax) it fails when calling fnOpen() function.
I have checked that the event is called successfully and logged some variables and all of them are ok. The event I add for handling the click event is shown below and the error I see with firebug in Firefox is "b is null"
"p.createElement("tr"),e=p.createElemen... b=B(this[n.iApiIndex]);if(typeof a!= ..." in the jquery.dataTables.min.js.
I'm using jquery 1.4.2 and the jquery.dataTables.min.js 1.7.2.
Thanks.
$('.addRowButton').live('click', function(){
console.log(this); //it's ok
console.log(this.parentNode); //it's ok
console.log(this.parentNode.parentNode); //it's ok
var nTr = this.parentNode.parentNode;
if($(this).is(".close")){
$table.fnClose( nTr );
$(this).removeClass("close");
}else{
$table.fnOpen( nTr, "my test message", 'details' );
$(this).addClass("close");
}
return false;
});
This discussion has been closed.