"Unable to re-initialise DataTable" error using tabletools

"Unable to re-initialise DataTable" error using tabletools

craigwardcraigward Posts: 17Questions: 0Answers: 0
edited June 2010 in General
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]

Replies

  • codingavenuecodingavenue Posts: 22Questions: 0Answers: 0
    Hi,

    Have you tried merging your two DataTables init code?

    codingavenue
  • craigwardcraigward Posts: 17Questions: 0Answers: 0
    Yes, doesn't seem to make a difference. Just keeps coming up with the same error.
  • craigwardcraigward Posts: 17Questions: 0Answers: 0
    The below throws the error, but if I change $('#properties_table').dataTable({ to $('#example').dataTable({

    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]
  • codingavenuecodingavenue Posts: 22Questions: 0Answers: 0
    Hi,

    What I mean by merging is moving your "sDom" initialization to the first initialization code. This way you only initialize datatable once.

    codingavenue
  • craigwardcraigward Posts: 17Questions: 0Answers: 0
    :) worked, cheers. Still new to this Jquery lark. Thanks for all the help

    Craig
  • codingavenuecodingavenue Posts: 22Questions: 0Answers: 0
    Hi,

    Glad it worked :)

    codingavenue
This discussion has been closed.