tag element is being stripped by DataTables...
tag element is being stripped by DataTables...
I'm being bitten by a mysterious stripping of my tags for the first item in my table.
I cannot for the life of me figure out why. It DOES NOT happen all the time. But SOMETIMES the element for the first row is getting stripped between the time the browser gets the source, and DataTables re-rendering the DOM table.
In other words, I check the page source and I see my tag element for the first row in the table. But if I check the "Inspect Element" Chrome tool, I see that the element for that row is now missing.
Here's my DataTable definition:
[code]
$('#class_summary').dataTable( {
"bAutoWidth": false,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aLengthMenu": [[10,25,50,100,-1], [10,25,50,100,"All"]],
"iDisplayLength": -1,
"aoColumnDefs": [
{ "aTargets":[0], "bSearchable": false, "bVisible": false },
{ "aTargets":[1], "sType": "string" }
],
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
$('#class_summary tbody tr').live('click', function(){
f = document.getElementById( 'class_summary_' + aData[0] );
if(f)
{
f.submit();
}
});
}
} )
[/code]
Here's my DOM Table's element source as seen in View Page Source:
[code]
588_1
Core Class
546_2
Good Class
[/code]
Here's the DataTables' rendered from the DOM table as seen in Chrome's Inspect Element tool:
[code]
Good Class
Core Class
[/code]
Weird.
Help!
Jz.
I cannot for the life of me figure out why. It DOES NOT happen all the time. But SOMETIMES the element for the first row is getting stripped between the time the browser gets the source, and DataTables re-rendering the DOM table.
In other words, I check the page source and I see my tag element for the first row in the table. But if I check the "Inspect Element" Chrome tool, I see that the element for that row is now missing.
Here's my DataTable definition:
[code]
$('#class_summary').dataTable( {
"bAutoWidth": false,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aLengthMenu": [[10,25,50,100,-1], [10,25,50,100,"All"]],
"iDisplayLength": -1,
"aoColumnDefs": [
{ "aTargets":[0], "bSearchable": false, "bVisible": false },
{ "aTargets":[1], "sType": "string" }
],
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
$('#class_summary tbody tr').live('click', function(){
f = document.getElementById( 'class_summary_' + aData[0] );
if(f)
{
f.submit();
}
});
}
} )
[/code]
Here's my DOM Table's element source as seen in View Page Source:
[code]
588_1
Core Class
546_2
Good Class
[/code]
Here's the DataTables' rendered from the DOM table as seen in Chrome's Inspect Element tool:
[code]
Good Class
Core Class
[/code]
Weird.
Help!
Jz.
This discussion has been closed.
Replies
Allan