Error when using fnAdjustColumnSizing in fnDrawCallback
Error when using fnAdjustColumnSizing in fnDrawCallback
I get a "stack overflow error at line 16" when I use fnAdjustColumnSizing in fnDrawCallback. I don't get the error when I use fnAdjustColumnSizing in fnInitComplete, but it doesn't adjust the thead to match the tbody when I run it at init only.
function setRelationships(partData)
{
var rows = new Array();
for(i in partData.relationships)
{
var row = new Array(
partData.relationships[i].cat_num,
partData.relationships[i].description,
partData.relationships[i].equip_type,
partData.relationships[i].relationship_type
);
rows.push(row);
}
$('#tbl_relationships').dataTable({
"aaData": rows,
"bAutoWidth": true,
"bDestroy": true,
"aLengthMenu": [[10, 20, 50, 100], [10, 20, 50, 100]],
"aaSorting": [[ 1, "asc" ]],
"iDisplayLength": 20,
"sScrollY": "270px",
"bScrollCollapse": true,
"fnDrawCallback": function(){
this.fnAdjustColumnSizing();
}
});
}
function setRelationships(partData)
{
var rows = new Array();
for(i in partData.relationships)
{
var row = new Array(
partData.relationships[i].cat_num,
partData.relationships[i].description,
partData.relationships[i].equip_type,
partData.relationships[i].relationship_type
);
rows.push(row);
}
$('#tbl_relationships').dataTable({
"aaData": rows,
"bAutoWidth": true,
"bDestroy": true,
"aLengthMenu": [[10, 20, 50, 100], [10, 20, 50, 100]],
"aaSorting": [[ 1, "asc" ]],
"iDisplayLength": 20,
"sScrollY": "270px",
"bScrollCollapse": true,
"fnDrawCallback": function(){
this.fnAdjustColumnSizing();
}
});
}
This discussion has been closed.