1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-18 11:52:11 +01:00

New: ajax.params() method to get the data for the last Ajax submit

This commit is contained in:
Allan Jardine 2014-03-06 10:05:46 +00:00
parent c32f4c032a
commit 92e380c778
2 changed files with 25 additions and 1 deletions

View File

@ -1 +1 @@
a6c7cb0ca4c65e14d41f7c339c9f1190c11453b8
a0fac0689db72b158ac0a905a32bf9724f630c5e

View File

@ -2294,6 +2294,9 @@
}
};
// Store the data submitted for the API
oSettings.oAjaxData = data;
if ( oSettings.fnServerData )
{
// DataTables 1.9- compatibility
@ -7119,6 +7122,20 @@
} );
/**
* Get the data submitted in the last Ajax request
*/
_api_register( 'ajax.params()', function () {
var ctx = this.context;
if ( ctx.length > 0 ) {
return ctx[0].oAjaxData;
}
// else return undefined;
} );
/**
* Reload tables from the Ajax data source. Note that this function will
* automatically re-draw the table when the remote data has been loaded.
@ -12638,6 +12655,13 @@
*/
"json": undefined,
/**
* Data submitted as part of the last Ajax request
* @type object
* @default undefined
*/
"oAjaxData": undefined,
/**
* Function to get the server-side data.
* Note that this parameter will be set by the initialisation routine. To