datatables.net 2.1.5 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/js/dataTables.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! DataTables 2.1.5
1
+ /*! DataTables 2.1.6
2
2
  * © SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
@@ -201,6 +201,7 @@ var DataTable = function ( selector, options )
201
201
  "caption",
202
202
  "layout",
203
203
  "orderDescReverse",
204
+ "typeDetect",
204
205
  [ "iCookieDuration", "iStateDuration" ], // backwards compat
205
206
  [ "oSearch", "oPreviousSearch" ],
206
207
  [ "aoSearchCols", "aoPreSearchCols" ],
@@ -424,7 +425,7 @@ var DataTable = function ( selector, options )
424
425
  } );
425
426
  }
426
427
  else {
427
- _fnCallbackFire( oSettings, null, 'i18n', [oSettings]);
428
+ _fnCallbackFire( oSettings, null, 'i18n', [oSettings], true);
428
429
  _fnInitialise( oSettings );
429
430
  }
430
431
  } );
@@ -1164,7 +1165,7 @@ var _pluck_order = function ( a, order, prop, prop2 )
1164
1165
  // is essential here
1165
1166
  if ( prop2 !== undefined ) {
1166
1167
  for ( ; i<ien ; i++ ) {
1167
- if ( a[ order[i] ][ prop ] ) {
1168
+ if ( a[ order[i] ] && a[ order[i] ][ prop ] ) {
1168
1169
  out.push( a[ order[i] ][ prop ][ prop2 ] );
1169
1170
  }
1170
1171
  }
@@ -2221,12 +2222,6 @@ function _fnColumnTypes ( settings )
2221
2222
  var i, ien, j, jen, k, ken;
2222
2223
  var col, detectedType, cache;
2223
2224
 
2224
- // If SSP then we don't have the full data set, so any type detection would be
2225
- // unreliable and error prone
2226
- if (_fnDataSource( settings ) === 'ssp') {
2227
- return;
2228
- }
2229
-
2230
2225
  // For each column, spin over the data type detection functions, seeing if one matches
2231
2226
  for ( i=0, ien=columns.length ; i<ien ; i++ ) {
2232
2227
  col = columns[i];
@@ -2236,6 +2231,12 @@ function _fnColumnTypes ( settings )
2236
2231
  col.sType = col._sManualType;
2237
2232
  }
2238
2233
  else if ( ! col.sType ) {
2234
+ // With SSP type detection can be unreliable and error prone, so we provide a way
2235
+ // to turn it off.
2236
+ if (! settings.typeDetect) {
2237
+ return;
2238
+ }
2239
+
2239
2240
  for ( j=0, jen=types.length ; j<jen ; j++ ) {
2240
2241
  var typeDetect = types[j];
2241
2242
 
@@ -4287,6 +4288,7 @@ function _fnAjaxUpdateDraw ( settings, json )
4287
4288
  }
4288
4289
  settings.aiDisplay = settings.aiDisplayMaster.slice();
4289
4290
 
4291
+ _fnColumnTypes(settings);
4290
4292
  _fnDraw( settings, true );
4291
4293
  _fnInitComplete( settings );
4292
4294
  _fnProcessingDisplay( settings, false );
@@ -9807,7 +9809,7 @@ _api_register( 'i18n()', function ( token, def, plural ) {
9807
9809
  * @type string
9808
9810
  * @default Version number
9809
9811
  */
9810
- DataTable.version = "2.1.5";
9812
+ DataTable.version = "2.1.6";
9811
9813
 
9812
9814
  /**
9813
9815
  * Private data store, containing all of the settings objects that are
@@ -11907,7 +11909,10 @@ DataTable.models.oSettings = {
11907
11909
  colgroup: null,
11908
11910
 
11909
11911
  /** Delay loading of data */
11910
- deferLoading: null
11912
+ deferLoading: null,
11913
+
11914
+ /** Allow auto type detection */
11915
+ typeDetect: true
11911
11916
  };
11912
11917
 
11913
11918
  /**
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "js/dataTables.js",
5
5
  "module": "js/dataTables.mjs",
6
6
  "types": "./types/types.d.ts",
7
- "version": "2.1.5",
7
+ "version": "2.1.6",
8
8
  "files": [
9
9
  "js/**/*.js",
10
10
  "js/**/*.mjs",