How to repeat fnInitComplete functions after a an fnReloadAjax?
How to repeat fnInitComplete functions after a an fnReloadAjax?
TonyFavilla
Posts: 3Questions: 0Answers: 0
Hello,
I've got 2 wonderfull tables working without any problem and in my page there is a button that lauch a function composed by
oTable.fnClearTable( 0 );
oTable.fnReloadAjax('...');
oTable.fnDraw();
And it's ok.
But after this i'd like to repeat the operations declared in fnInitComplete, how can i do?
I've got 2 wonderfull tables working without any problem and in my page there is a button that lauch a function composed by
oTable.fnClearTable( 0 );
oTable.fnReloadAjax('...');
oTable.fnDraw();
And it's ok.
But after this i'd like to repeat the operations declared in fnInitComplete, how can i do?
This discussion has been closed.
Replies
if you save the init object into a variable, you can reuse it
[code]
$(document).ready(function() {
oInit = {
bDestroy: true,
sAjaxSource: ' ... ',
// etc.
}
$('#example').dataTable(oInit);
$('#somebutton').click(function() {
$('#example').dataTable(oInit); // re-init table.
});
});
[/code]
Allan
Even if the allan's one is more polite i used the fbas solution editing the sAjaxSource because it was easier to make it work correctly :)
Thank you guys for your great work!