"Unable to re-initialise DataTable" error using tabletools
"Unable to re-initialise DataTable" error using tabletools
DataTables warning: Unable to re-initialise DataTable. Please use the API to make any configuration changes required.
I get the above error when I try to plug in tabletools. I can't seem to get it to work at all, below is the code I used
[code]
$(document).ready(function() {
$('#properties_table').dataTable({
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : "pull_propertylist.php",
"bJQueryUI" : true,
"bPaginate" : true,
"sPaginationType" : "full_numbers",
"bFilter" : true,
"bSort" : true,
"bInfo" : true,
"bStateSave" : true,
"bLengthChange" : true,
"bAutoWidth" : true
});
});
$(document).ready( function () {
/* You might need to set the sSwfPath! Something like:
* TableToolsInit.sSwfPath = "/media/swf/ZeroClipboard.swf";
*/
$('#properties_table').dataTable( {
"sDom": 'T<"clear">lfrtip'
} );
} );
[/code]
I get the above error when I try to plug in tabletools. I can't seem to get it to work at all, below is the code I used
[code]
$(document).ready(function() {
$('#properties_table').dataTable({
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : "pull_propertylist.php",
"bJQueryUI" : true,
"bPaginate" : true,
"sPaginationType" : "full_numbers",
"bFilter" : true,
"bSort" : true,
"bInfo" : true,
"bStateSave" : true,
"bLengthChange" : true,
"bAutoWidth" : true
});
});
$(document).ready( function () {
/* You might need to set the sSwfPath! Something like:
* TableToolsInit.sSwfPath = "/media/swf/ZeroClipboard.swf";
*/
$('#properties_table').dataTable( {
"sDom": 'T<"clear">lfrtip'
} );
} );
[/code]
This discussion has been closed.
Replies
Have you tried merging your two DataTables init code?
codingavenue
There is no error, but obviously doesn't work
[code]
$(document).ready(function() {
$('#properties_table').dataTable({
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : "pull_propertylist.php",
"bJQueryUI" : true,
"bPaginate" : true,
"sPaginationType" : "full_numbers",
"bFilter" : true,
"bSort" : true,
"bInfo" : true,
"bStateSave" : true,
"bLengthChange" : true,
"bAutoWidth" : true
});
$('#properties_table').dataTable({
"sDom": 'T<"clear">lfrtip'
});
});
[/code]
What I mean by merging is moving your "sDom" initialization to the first initialization code. This way you only initialize datatable once.
codingavenue
Craig
Glad it worked :)
codingavenue