mirror of
https://github.com/DataTables/DataTables.git
synced 2025-03-15 16:29:16 +01:00
Fix: Ajax data wasn't being sent for non-server-side processing
- If you used client-side processing ajax, the parameter passed into _fnBuildAjax is an array, needed for the old 1.9 compatiblity, but the ajax wasn't transforming this into a data object and then sending it to the server. The fix is to check if the data passed in is an array or not - if so, transform it to an object
This commit is contained in:
parent
311cc96572
commit
b53ac91310
@ -1 +1 @@
|
||||
14b4db6bb356601614d94569a28d5deb98149d93
|
||||
4d968710b6b942e511f833c96dc45c1533ec1db0
|
||||
|
7
media/js/jquery.dataTables.js
vendored
7
media/js/jquery.dataTables.js
vendored
@ -2259,8 +2259,9 @@
|
||||
// Compatibility with 1.9-, allow fnServerData and event to manipulate
|
||||
_fnCallbackFire( oSettings, 'aoServerParams', 'serverParams', [data] );
|
||||
|
||||
// Convert to object based for 1.10+ if using the old scheme
|
||||
if ( data && data.__legacy ) {
|
||||
// Convert to object based for 1.10+ if using the old array scheme which can
|
||||
// come from server-side processing or serverParams
|
||||
if ( data && $.isArray(data) ) {
|
||||
var tmp = {};
|
||||
var rbracket = /(.*?)\[\]$/;
|
||||
|
||||
@ -2492,8 +2493,6 @@
|
||||
param( 'iSortingCols', sort.length );
|
||||
}
|
||||
|
||||
data.__legacy = true;
|
||||
|
||||
// If the legacy.ajax parameter is null, then we automatically decide which
|
||||
// form to use, based on sAjaxSource
|
||||
var legacy = DataTable.ext.legacy.ajax;
|
||||
|
Loading…
x
Reference in New Issue
Block a user