We getting an error like this when loading page: Datatables warning(table id = 'at_104'): cannot reinitialise data table. To retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy.
I was trying to test the fnRowCallback and added to $dtCode
Code: |
$(document).ready(function() {
$("#%1$s").dataTable( {
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull){
if(aData[0]=="KC978"){
$(nRow).addClass("delay");
}return nRow;
}
}
);
});
|
full $dtCode is
Code: |
$dtCode = sprintf('if (typeof(AriDataTables) != "undefined") AriDataTables.hideLoadingPane("#%1$s_wrapper");var options = %2$s;options["fnDrawCallback"] = function(oSettings) { adt_DataTable_DrawCallback(oSettings) };$("#%1$s").addClass("display dataTable").dataTable(options); $(document).ready(function() {$("#%1$s").dataTable( {"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull){if(aData[0]=="KC978"){$(nRow).addClass("delay");}return nRow;}} );});',
$id,
!empty($jsOptions) ? AriJSONHelper::encode($jsOptions) : ''
//!empty($jsOptions['bJQueryUI']) ? sprintf('/*$("#%1$s_wrapper").find(".dataTables_wrapper").addClass("ui-widget-content")*/', $id) : ''
);
|
What we have done wrong?