Unable to re-initialise DataTable. Please use the API to make any configuration changes required.
Unable to re-initialise DataTable. Please use the API to make any configuration changes required.
hi allan,my English is poor.so I as simple as possible to say my problem.
var oTable;
$(document).ready(function() {
oTable = $('#tt').dataTable({
"bProcessing": true,
"bAutoWidth": false,
"bSortClasses": false,
"bStateSave": false,
"aoColumns": [{ "bSortable": false,"sWidth": "5%" },{ "sWidth": "10%" },{ "sWidth": "25%" },{ "sWidth": "25%" },{ "sWidth": "5%" },null,null ],
"sPaginationType": "full_numbers",
"sDom": 'Tlfrtip',
"sAjaxSource":'1.xml'
});
var aa = $("#tt").dataTable().fnGetNodes();
$(aa).hover(function(){$(this).addClass("over")},function(){$(this).removeClass("over")}).click(function(){$(this).toggleClass("clk")})
} );
title1
title2
title3
title4
title5
title6
the contents of 1.xml is the same to json_source.txt
now?ctrl+F5 my webpage , alert that:DataTables warning: Unable to re-initialise DataTable. Please use the API to make any configuration changes required.
but $(aa).hover(function(){$(this).addClass("over")},function(){$(this).removeClass("over")}).click(function(){$(this).toggleClass("clk")}) is worked!
i hope i can Expressed my problem clearly. and i hope you can tell me the answer.
thank you very much!
var oTable;
$(document).ready(function() {
oTable = $('#tt').dataTable({
"bProcessing": true,
"bAutoWidth": false,
"bSortClasses": false,
"bStateSave": false,
"aoColumns": [{ "bSortable": false,"sWidth": "5%" },{ "sWidth": "10%" },{ "sWidth": "25%" },{ "sWidth": "25%" },{ "sWidth": "5%" },null,null ],
"sPaginationType": "full_numbers",
"sDom": 'Tlfrtip',
"sAjaxSource":'1.xml'
});
var aa = $("#tt").dataTable().fnGetNodes();
$(aa).hover(function(){$(this).addClass("over")},function(){$(this).removeClass("over")}).click(function(){$(this).toggleClass("clk")})
} );
title1
title2
title3
title4
title5
title6
the contents of 1.xml is the same to json_source.txt
now?ctrl+F5 my webpage , alert that:DataTables warning: Unable to re-initialise DataTable. Please use the API to make any configuration changes required.
but $(aa).hover(function(){$(this).addClass("over")},function(){$(this).removeClass("over")}).click(function(){$(this).toggleClass("clk")}) is worked!
i hope i can Expressed my problem clearly. and i hope you can tell me the answer.
thank you very much!
This discussion has been closed.
Replies
[code]
var oTable;
$(document).ready(function() {
oTable = $('#tt').dataTable({
"bProcessing": true,
"bAutoWidth": false,
"bSortClasses": false,
"bStateSave": false,
"aoColumns": [{ "bSortable": false,"sWidth": "5%" },{ "sWidth": "10%" },{ "sWidth": "25%" },{ "sWidth": "25%" },{ "sWidth": "5%" },null,null ],
"sPaginationType": "full_numbers",
"sDom": 'Tlfrtip',
"sAjaxSource":'1.xml'
});
var aa = oTable.fnGetNodes();
$(aa).hover(function(){$(this).addClass("over")},function(){$(this).removeClass("over")}).click(function(){$(this).toggleClass("clk")})
} );
[/code]
Note that the change is in the assignment of the var aa.
Allan
Good to hear that worked for you.
Regards,
Allan