Hi !
I'm trying to populate a table using an AJAX source, without server-side processing.
I think this is related to this post : http://datatables.net/forums/discussion/34/fninitcomplete-exists-or-just-a-myth/p1
But in my case, the DataTables params are externalized and not passed directly in the dataTable function.
Here is the code :
The error is :
When I remove the fnInitComplete parameter, it works well.
Any idea ?
Thanks !
I'm trying to populate a table using an AJAX source, without server-side processing.
I think this is related to this post : http://datatables.net/forums/discussion/34/fninitcomplete-exists-or-just-a-myth/p1
But in my case, the DataTables params are externalized and not passed directly in the dataTable function.
Here is the code :
var oTable_myTableId;
var oTable_myTableId_params = {
"bDeferRender":true,
"sDom":"lfrtip",
"fnInitComplete":function() {
oTable_myTableId.fnAdjustColumnSizing(true);
},
"aoColumns":[
{
"mData":"id",
},
{
"mData":"firstName",
},
{
"mData":"lastName",
},
{
"mData":"address.town.name",
},
{
"mData":"mail",
}
]
};
$(document).ready(function(){
$.ajax({
url:'myUrl',
dataType: 'json',
async: false,
success: function(data){
oTable_myTableId_params.aaData = data;
oTable_myTableId = $('#myTableId').dataTable(oTable_myTableId_params);
});
});
The error is :
Uncaught TypeError: Cannot call method 'fnAdjustColumnSizing' of undefined
When I remove the fnInitComplete parameter, it works well.
Any idea ?
Thanks !