fnReloadAjax: incorrect number of parameters
fnReloadAjax: incorrect number of parameters
Hi!
I'm using datatables 1.9.4 with ajax call and the plug-ins fnReloadAjax.
I'm front of a problem i cannot explain:
I want to launch a callback function after the ajax reload.
The function fnReloadAjax is :
[code]$.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource, fnCallback, bStandingRedraw ) [/code]
Ok, so i call it like this:
[code]var table = $("#myTable").dataTable();
table.fnReloadAjax(table.oSettings, null, myCallbackFunction); [/code]
But when i debug into the fnReloadAjax function, fnCallback is null! The function "myCallbackFunction" is passed in the argument bStandingRedraw!
The solution is to remove the sNewSource parameters when calling the function like this:
[code]var table = $("#myTable").dataTable();
table.fnReloadAjax(table.oSettings, myCallbackFunction); [/code]
It works fine now, but i can't understand why this is happening... Someone can explain me?
Thanks!
I'm using datatables 1.9.4 with ajax call and the plug-ins fnReloadAjax.
I'm front of a problem i cannot explain:
I want to launch a callback function after the ajax reload.
The function fnReloadAjax is :
[code]$.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource, fnCallback, bStandingRedraw ) [/code]
Ok, so i call it like this:
[code]var table = $("#myTable").dataTable();
table.fnReloadAjax(table.oSettings, null, myCallbackFunction); [/code]
But when i debug into the fnReloadAjax function, fnCallback is null! The function "myCallbackFunction" is passed in the argument bStandingRedraw!
The solution is to remove the sNewSource parameters when calling the function like this:
[code]var table = $("#myTable").dataTable();
table.fnReloadAjax(table.oSettings, myCallbackFunction); [/code]
It works fine now, but i can't understand why this is happening... Someone can explain me?
Thanks!
This discussion has been closed.
Replies
http://live.datatables.net/eqazet/4/edit#source
My function callback doesn't alert here , I don't know why, but it's not the problem.
Just follow the instruction I wrote in the html...
> fnReloadAjax function ( sNewSource, fnCallback, bStandingRedraw )
This is noted at the top of the API plug-ins page:
> Please note that DataTables will automatically pass the settings object as the first parameter. As such, you do not need to pass the settings object, which you will see if you look at the plug-in API's code.
Allan