datatables.net 2.3.2 → 2.3.4

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.3.2
1
+ /*! DataTables 2.3.4
2
2
  * © SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
@@ -131,6 +131,9 @@ var DataTable = function ( selector, options )
131
131
  this.id = sId;
132
132
  }
133
133
 
134
+ // Replacing an existing colgroup with our own. Not ideal, but a merge could take a lot of code
135
+ $this.children('colgroup').remove();
136
+
134
137
  /* Create the settings object for this table and set some of the default parameters */
135
138
  var oSettings = $.extend( true, {}, DataTable.models.oSettings, {
136
139
  "sDestroyWidth": $this[0].style.width,
@@ -696,7 +699,7 @@ DataTable.ext = _ext = {
696
699
  *
697
700
  * The extension options for ordering of data available here is complimentary
698
701
  * to the default type based ordering that DataTables typically uses. It
699
- * allows much greater control over the the data that is being used to
702
+ * allows much greater control over the data that is being used to
700
703
  * order a column, but is necessarily therefore more complex.
701
704
  *
702
705
  * This type of ordering is useful if you want to do ordering based on data
@@ -855,7 +858,7 @@ DataTable.ext = _ext = {
855
858
  * `{type}-asc` and `{type}-desc` together. It is generally recommended
856
859
  * that only `{type}-pre` is used, as this provides the optimal
857
860
  * implementation in terms of speed, although the others are provided
858
- * for compatibility with existing Javascript sort functions.
861
+ * for compatibility with existing JavaScript sort functions.
859
862
  *
860
863
  * `{type}-pre`: Functions defined take a single parameter:
861
864
  *
@@ -865,7 +868,7 @@ DataTable.ext = _ext = {
865
868
  *
866
869
  * * `{*}` Data to be sorted upon
867
870
  *
868
- * `{type}-asc` and `{type}-desc`: Functions are typical Javascript sort
871
+ * `{type}-asc` and `{type}-desc`: Functions are typical JavaScript sort
869
872
  * functions, taking two parameters:
870
873
  *
871
874
  * 1. `{*}` Data to compare to the second parameter
@@ -1089,7 +1092,7 @@ var _intVal = function ( s ) {
1089
1092
  };
1090
1093
 
1091
1094
  // Convert from a formatted number with characters other than `.` as the
1092
- // decimal place, to a Javascript number
1095
+ // decimal place, to a JavaScript number
1093
1096
  var _numToDecimal = function ( num, decimalPoint ) {
1094
1097
  // Cache created regular expressions for speed as this function is called often
1095
1098
  if ( ! _re_dic[ decimalPoint ] ) {
@@ -1155,19 +1158,19 @@ var _htmlNumeric = function ( d, decimalPoint, formatted, allowEmpty ) {
1155
1158
 
1156
1159
  var _pluck = function ( a, prop, prop2 ) {
1157
1160
  var out = [];
1158
- var i=0, ien=a.length;
1161
+ var i=0, iLen=a.length;
1159
1162
 
1160
1163
  // Could have the test in the loop for slightly smaller code, but speed
1161
1164
  // is essential here
1162
1165
  if ( prop2 !== undefined ) {
1163
- for ( ; i<ien ; i++ ) {
1166
+ for ( ; i<iLen ; i++ ) {
1164
1167
  if ( a[i] && a[i][ prop ] ) {
1165
1168
  out.push( a[i][ prop ][ prop2 ] );
1166
1169
  }
1167
1170
  }
1168
1171
  }
1169
1172
  else {
1170
- for ( ; i<ien ; i++ ) {
1173
+ for ( ; i<iLen ; i++ ) {
1171
1174
  if ( a[i] ) {
1172
1175
  out.push( a[i][ prop ] );
1173
1176
  }
@@ -1183,19 +1186,19 @@ var _pluck = function ( a, prop, prop2 ) {
1183
1186
  var _pluck_order = function ( a, order, prop, prop2 )
1184
1187
  {
1185
1188
  var out = [];
1186
- var i=0, ien=order.length;
1189
+ var i=0, iLen=order.length;
1187
1190
 
1188
1191
  // Could have the test in the loop for slightly smaller code, but speed
1189
1192
  // is essential here
1190
1193
  if ( prop2 !== undefined ) {
1191
- for ( ; i<ien ; i++ ) {
1194
+ for ( ; i<iLen ; i++ ) {
1192
1195
  if ( a[ order[i] ] && a[ order[i] ][ prop ] ) {
1193
1196
  out.push( a[ order[i] ][ prop ][ prop2 ] );
1194
1197
  }
1195
1198
  }
1196
1199
  }
1197
1200
  else {
1198
- for ( ; i<ien ; i++ ) {
1201
+ for ( ; i<iLen ; i++ ) {
1199
1202
  if ( a[ order[i] ] ) {
1200
1203
  out.push( a[ order[i] ][ prop ] );
1201
1204
  }
@@ -1232,7 +1235,7 @@ var _removeEmpty = function ( a )
1232
1235
  {
1233
1236
  var out = [];
1234
1237
 
1235
- for ( var i=0, ien=a.length ; i<ien ; i++ ) {
1238
+ for ( var i=0, iLen=a.length ; i<iLen ; i++ ) {
1236
1239
  if ( a[i] ) { // careful - will remove all falsy values!
1237
1240
  out.push( a[i] );
1238
1241
  }
@@ -1318,7 +1321,7 @@ var _areAllUnique = function ( src ) {
1318
1321
  var sorted = src.slice().sort();
1319
1322
  var last = sorted[0];
1320
1323
 
1321
- for ( var i=1, ien=sorted.length ; i<ien ; i++ ) {
1324
+ for ( var i=1, iLen=sorted.length ; i<iLen ; i++ ) {
1322
1325
  if ( sorted[i] === last ) {
1323
1326
  return false;
1324
1327
  }
@@ -1354,10 +1357,10 @@ var _unique = function ( src )
1354
1357
  var
1355
1358
  out = [],
1356
1359
  val,
1357
- i, ien=src.length,
1360
+ i, iLen=src.length,
1358
1361
  j, k=0;
1359
1362
 
1360
- again: for ( i=0 ; i<ien ; i++ ) {
1363
+ again: for ( i=0 ; i<iLen ; i++ ) {
1361
1364
  val = src[i];
1362
1365
 
1363
1366
  for ( j=0 ; j<k ; j++ ) {
@@ -1891,7 +1894,7 @@ function _fnCompatOpts ( init )
1891
1894
  var searchCols = init.aoSearchCols;
1892
1895
 
1893
1896
  if ( searchCols ) {
1894
- for ( var i=0, ien=searchCols.length ; i<ien ; i++ ) {
1897
+ for ( var i=0, iLen=searchCols.length ; i<iLen ; i++ ) {
1895
1898
  if ( searchCols[i] ) {
1896
1899
  _fnCamelToHungarian( DataTable.models.oSearch, searchCols[i] );
1897
1900
  }
@@ -2044,7 +2047,7 @@ function _fnColumnOptions( oSettings, iCol, oOptions )
2044
2047
  oCol._sManualType = oOptions.sType;
2045
2048
  }
2046
2049
 
2047
- // `class` is a reserved word in Javascript, so we need to provide
2050
+ // `class` is a reserved word in JavaScript, so we need to provide
2048
2051
  // the ability to use a valid name for the camel case input
2049
2052
  if ( oOptions.className && ! oOptions.sClass )
2050
2053
  {
@@ -2201,14 +2204,14 @@ function _fnColumnIndexToVisible( oSettings, iMatch )
2201
2204
  * @returns {int} i the number of visible columns
2202
2205
  * @memberof DataTable#oApi
2203
2206
  */
2204
- function _fnVisbleColumns( settings )
2207
+ function _fnVisibleColumns( settings )
2205
2208
  {
2206
2209
  var layout = settings.aoHeader;
2207
2210
  var columns = settings.aoColumns;
2208
2211
  var vis = 0;
2209
2212
 
2210
2213
  if ( layout.length ) {
2211
- for ( var i=0, ien=layout[0].length ; i<ien ; i++ ) {
2214
+ for ( var i=0, iLen=layout[0].length ; i<iLen ; i++ ) {
2212
2215
  if ( columns[i].bVisible && $(layout[0][i].cell).css('display') !== 'none' ) {
2213
2216
  vis++;
2214
2217
  }
@@ -2243,7 +2246,7 @@ function _fnGetColumns( oSettings, sParam )
2243
2246
  /**
2244
2247
  * Allow the result from a type detection function to be `true` while
2245
2248
  * translating that into a string. Old type detection functions will
2246
- * return the type name if it passes. An obect store would be better,
2249
+ * return the type name if it passes. An object store would be better,
2247
2250
  * but not backwards compatible.
2248
2251
  *
2249
2252
  * @param {*} typeDetect Object or function for type detection
@@ -2266,11 +2269,11 @@ function _fnColumnTypes ( settings )
2266
2269
  var columns = settings.aoColumns;
2267
2270
  var data = settings.aoData;
2268
2271
  var types = DataTable.ext.type.detect;
2269
- var i, ien, j, jen, k, ken;
2272
+ var i, iLen, j, jen, k, ken;
2270
2273
  var col, detectedType, cache;
2271
2274
 
2272
2275
  // For each column, spin over the data type detection functions, seeing if one matches
2273
- for ( i=0, ien=columns.length ; i<ien ; i++ ) {
2276
+ for ( i=0, iLen=columns.length ; i<iLen ; i++ ) {
2274
2277
  col = columns[i];
2275
2278
  cache = [];
2276
2279
 
@@ -2540,7 +2543,7 @@ function _fnColumnsSumWidth( settings, targets, original, incVisible ) {
2540
2543
  var unit;
2541
2544
  var columns = settings.aoColumns;
2542
2545
 
2543
- for ( var i=0, ien=targets.length ; i<ien ; i++ ) {
2546
+ for ( var i=0, iLen=targets.length ; i<iLen ; i++ ) {
2544
2547
  var column = columns[ targets[i] ];
2545
2548
  var definedWidth = original ?
2546
2549
  column.sWidthOrig :
@@ -2586,7 +2589,7 @@ function _fnColumnsFromHeader( cell )
2586
2589
  }
2587
2590
  /**
2588
2591
  * Add a data array to the table, creating DOM node etc. This is the parallel to
2589
- * _fnGatherData, but for adding rows from a Javascript source, rather than a
2592
+ * _fnGatherData, but for adding rows from a JavaScript source, rather than a
2590
2593
  * DOM source.
2591
2594
  * @param {object} settings dataTables settings object
2592
2595
  * @param {array} data data array to be added
@@ -2726,10 +2729,10 @@ function _fnGetCellData( settings, rowIdx, colIdx, type )
2726
2729
  }
2727
2730
 
2728
2731
  if ( type === 'filter' ) {
2729
- var fomatters = DataTable.ext.type.search;
2732
+ var formatters = DataTable.ext.type.search;
2730
2733
 
2731
- if ( fomatters[ col.sType ] ) {
2732
- cellData = fomatters[ col.sType ]( cellData );
2734
+ if ( formatters[ col.sType ] ) {
2735
+ cellData = formatters[ col.sType ]( cellData );
2733
2736
  }
2734
2737
  }
2735
2738
 
@@ -2859,7 +2862,7 @@ function _fnClearTable( settings )
2859
2862
  function _fnInvalidate( settings, rowIdx, src, colIdx )
2860
2863
  {
2861
2864
  var row = settings.aoData[ rowIdx ];
2862
- var i, ien;
2865
+ var i, iLen;
2863
2866
 
2864
2867
  // Remove the cached data for the row
2865
2868
  row._aSortData = null;
@@ -2884,7 +2887,7 @@ function _fnInvalidate( settings, rowIdx, src, colIdx )
2884
2887
  _fnWriteCell(cells[colIdx], display[colIdx]);
2885
2888
  }
2886
2889
  else {
2887
- for ( i=0, ien=cells.length ; i<ien ; i++ ) {
2890
+ for ( i=0, iLen=cells.length ; i<iLen ; i++ ) {
2888
2891
  _fnWriteCell(cells[i], display[i]);
2889
2892
  }
2890
2893
  }
@@ -2902,7 +2905,7 @@ function _fnInvalidate( settings, rowIdx, src, colIdx )
2902
2905
  cols[ colIdx ].maxLenString = null;
2903
2906
  }
2904
2907
  else {
2905
- for ( i=0, ien=cols.length ; i<ien ; i++ ) {
2908
+ for ( i=0, iLen=cols.length ; i<iLen ; i++ ) {
2906
2909
  cols[i].sType = null;
2907
2910
  cols[i].maxLenString = null;
2908
2911
  }
@@ -3201,7 +3204,7 @@ function _fnBuildHead( settings, side )
3201
3204
  {
3202
3205
  var classes = settings.oClasses;
3203
3206
  var columns = settings.aoColumns;
3204
- var i, ien, row;
3207
+ var i, iLen, row;
3205
3208
  var target = side === 'header'
3206
3209
  ? settings.nTHead
3207
3210
  : settings.nTFoot;
@@ -3229,7 +3232,7 @@ function _fnBuildHead( settings, side )
3229
3232
  cellCount += this.colSpan;
3230
3233
  });
3231
3234
 
3232
- for ( i=cellCount, ien=columns.length ; i<ien ; i++ ) {
3235
+ for ( i=cellCount, iLen=columns.length ; i<iLen ; i++ ) {
3233
3236
  $('<th/>')
3234
3237
  .html( columns[i][titleProp] || '' )
3235
3238
  .appendTo( row );
@@ -3573,7 +3576,7 @@ function _emptyRow ( settings ) {
3573
3576
 
3574
3577
  return $( '<tr/>' )
3575
3578
  .append( $('<td />', {
3576
- 'colSpan': _fnVisbleColumns( settings ),
3579
+ 'colSpan': _fnVisibleColumns( settings ),
3577
3580
  'class': settings.oClasses.empty.row
3578
3581
  } ).html( zero ) )[0];
3579
3582
  }
@@ -3757,7 +3760,7 @@ function _layoutResolve( settings, row ) {
3757
3760
 
3758
3761
  var line = row[ item ].contents;
3759
3762
 
3760
- for ( var i=0, ien=line.length ; i<ien ; i++ ) {
3763
+ for ( var i=0, iLen=line.length ; i<iLen ; i++ ) {
3761
3764
  if ( ! line[i] ) {
3762
3765
  continue;
3763
3766
  }
@@ -3921,7 +3924,7 @@ function _fnLayoutDom( settings, dom, insert )
3921
3924
  /**
3922
3925
  * Use the DOM source to create up an array of header cells. The idea here is to
3923
3926
  * create a layout grid (array) of rows x columns, which contains a reference
3924
- * to the cell that that point in the grid (regardless of col/rowspan), such that
3927
+ * to the cell at that point in the grid (regardless of col/rowspan), such that
3925
3928
  * any column / row could be removed and the new grid constructed
3926
3929
  * @param {node} thead The header/footer element for the table
3927
3930
  * @returns {array} Calculated layout array
@@ -4123,24 +4126,21 @@ function _fnStart( oSettings )
4123
4126
  * DataTables - may be augmented by developer callbacks
4124
4127
  * @param {function} fn Callback function to run when data is obtained
4125
4128
  */
4126
- function _fnBuildAjax( oSettings, data, fn )
4127
- {
4129
+ function _fnBuildAjax(oSettings, data, fn) {
4128
4130
  var ajaxData;
4129
4131
  var ajax = oSettings.ajax;
4130
4132
  var instance = oSettings.oInstance;
4131
- var callback = function ( json ) {
4132
- var status = oSettings.jqXHR
4133
- ? oSettings.jqXHR.status
4134
- : null;
4133
+ var callback = function (json) {
4134
+ var status = oSettings.jqXHR ? oSettings.jqXHR.status : null;
4135
4135
 
4136
- if ( json === null || (typeof status === 'number' && status == 204 ) ) {
4136
+ if (json === null || (typeof status === 'number' && status == 204)) {
4137
4137
  json = {};
4138
- _fnAjaxDataSrc( oSettings, json, [] );
4138
+ _fnAjaxDataSrc(oSettings, json, []);
4139
4139
  }
4140
4140
 
4141
4141
  var error = json.error || json.sError;
4142
- if ( error ) {
4143
- _fnLog( oSettings, 0, error );
4142
+ if (error) {
4143
+ _fnLog(oSettings, 0, error);
4144
4144
  }
4145
4145
 
4146
4146
  // Microsoft often wrap JSON as a string in another JSON object
@@ -4148,30 +4148,27 @@ function _fnBuildAjax( oSettings, data, fn )
4148
4148
  if (json.d && typeof json.d === 'string') {
4149
4149
  try {
4150
4150
  json = JSON.parse(json.d);
4151
- }
4152
- catch (e) {
4151
+ } catch (e) {
4153
4152
  // noop
4154
4153
  }
4155
4154
  }
4156
4155
 
4157
4156
  oSettings.json = json;
4158
4157
 
4159
- _fnCallbackFire( oSettings, null, 'xhr', [oSettings, json, oSettings.jqXHR], true );
4160
- fn( json );
4158
+ _fnCallbackFire(oSettings, null, 'xhr', [oSettings, json, oSettings.jqXHR], true);
4159
+ fn(json);
4161
4160
  };
4162
4161
 
4163
- if ( $.isPlainObject( ajax ) && ajax.data )
4164
- {
4162
+ if ($.isPlainObject(ajax) && ajax.data) {
4165
4163
  ajaxData = ajax.data;
4166
4164
 
4167
- var newData = typeof ajaxData === 'function' ?
4168
- ajaxData( data, oSettings ) : // fn can manipulate data or return
4169
- ajaxData; // an object object or array to merge
4165
+ var newData =
4166
+ typeof ajaxData === 'function'
4167
+ ? ajaxData(data, oSettings) // fn can manipulate data or return
4168
+ : ajaxData; // an object or array to merge
4170
4169
 
4171
4170
  // If the function returned something, use that alone
4172
- data = typeof ajaxData === 'function' && newData ?
4173
- newData :
4174
- $.extend( true, data, newData );
4171
+ data = typeof ajaxData === 'function' && newData ? newData : $.extend(true, data, newData);
4175
4172
 
4176
4173
  // Remove the data property as we've resolved it already and don't want
4177
4174
  // jQuery to do it again (it is restored at the end of the function)
@@ -4179,50 +4176,53 @@ function _fnBuildAjax( oSettings, data, fn )
4179
4176
  }
4180
4177
 
4181
4178
  var baseAjax = {
4182
- "url": typeof ajax === 'string' ?
4183
- ajax :
4184
- '',
4185
- "data": data,
4186
- "success": callback,
4187
- "dataType": "json",
4188
- "cache": false,
4189
- "type": oSettings.sServerMethod,
4190
- "error": function (xhr, error) {
4191
- var ret = _fnCallbackFire( oSettings, null, 'xhr', [oSettings, null, oSettings.jqXHR], true );
4192
-
4193
- if ( ret.indexOf(true) === -1 ) {
4194
- if ( error == "parsererror" ) {
4195
- _fnLog( oSettings, 0, 'Invalid JSON response', 1 );
4179
+ url: typeof ajax === 'string' ? ajax : '',
4180
+ data: data,
4181
+ success: callback,
4182
+ dataType: 'json',
4183
+ cache: false,
4184
+ type: oSettings.sServerMethod,
4185
+ error: function (xhr, error) {
4186
+ var ret = _fnCallbackFire(
4187
+ oSettings,
4188
+ null,
4189
+ 'xhr',
4190
+ [oSettings, null, oSettings.jqXHR],
4191
+ true
4192
+ );
4193
+
4194
+ if (ret.indexOf(true) === -1) {
4195
+ if (error == 'parsererror') {
4196
+ _fnLog(oSettings, 0, 'Invalid JSON response', 1);
4196
4197
  }
4197
- else if ( xhr.readyState === 4 ) {
4198
- _fnLog( oSettings, 0, 'Ajax error', 7 );
4198
+ else if (xhr.readyState === 4) {
4199
+ _fnLog(oSettings, 0, 'Ajax error', 7);
4199
4200
  }
4200
4201
  }
4201
4202
 
4202
- _fnProcessingDisplay( oSettings, false );
4203
+ _fnProcessingDisplay(oSettings, false);
4203
4204
  }
4204
4205
  };
4205
4206
 
4206
4207
  // If `ajax` option is an object, extend and override our default base
4207
- if ( $.isPlainObject( ajax ) ) {
4208
- $.extend( baseAjax, ajax )
4208
+ if ($.isPlainObject(ajax)) {
4209
+ $.extend(baseAjax, ajax);
4209
4210
  }
4210
4211
 
4211
4212
  // Store the data submitted for the API
4212
4213
  oSettings.oAjaxData = data;
4213
4214
 
4214
4215
  // Allow plug-ins and external processes to modify the data
4215
- _fnCallbackFire( oSettings, null, 'preXhr', [oSettings, data, baseAjax], true );
4216
+ _fnCallbackFire(oSettings, null, 'preXhr', [oSettings, data, baseAjax], true);
4216
4217
 
4217
4218
  // Custom Ajax option to submit the parameters as a JSON string
4218
4219
  if (baseAjax.submitAs === 'json' && typeof data === 'object') {
4219
4220
  baseAjax.data = JSON.stringify(data);
4220
4221
  }
4221
4222
 
4222
- if ( typeof ajax === 'function' )
4223
- {
4223
+ if (typeof ajax === 'function') {
4224
4224
  // Is a function - let the caller define what needs to be done
4225
- oSettings.jqXHR = ajax.call( instance, data, callback, oSettings );
4225
+ oSettings.jqXHR = ajax.call(instance, data, callback, oSettings);
4226
4226
  }
4227
4227
  else if (ajax.url === '') {
4228
4228
  // No url, so don't load any data. Just apply an empty data array
@@ -4234,37 +4234,30 @@ function _fnBuildAjax( oSettings, data, fn )
4234
4234
  }
4235
4235
  else {
4236
4236
  // Object to extend the base settings
4237
- oSettings.jqXHR = $.ajax( baseAjax );
4237
+ oSettings.jqXHR = $.ajax(baseAjax);
4238
4238
  }
4239
4239
 
4240
4240
  // Restore for next time around
4241
- if ( ajaxData ) {
4241
+ if (ajaxData) {
4242
4242
  ajax.data = ajaxData;
4243
4243
  }
4244
4244
  }
4245
4245
 
4246
-
4247
4246
  /**
4248
4247
  * Update the table using an Ajax call
4249
4248
  * @param {object} settings dataTables settings object
4250
4249
  * @returns {boolean} Block the table drawing or not
4251
4250
  * @memberof DataTable#oApi
4252
4251
  */
4253
- function _fnAjaxUpdate( settings )
4254
- {
4252
+ function _fnAjaxUpdate(settings) {
4255
4253
  settings.iDraw++;
4256
- _fnProcessingDisplay( settings, true );
4254
+ _fnProcessingDisplay(settings, true);
4257
4255
 
4258
- _fnBuildAjax(
4259
- settings,
4260
- _fnAjaxParameters( settings ),
4261
- function(json) {
4262
- _fnAjaxUpdateDraw( settings, json );
4263
- }
4264
- );
4256
+ _fnBuildAjax(settings, _fnAjaxParameters(settings), function (json) {
4257
+ _fnAjaxUpdateDraw(settings, json);
4258
+ });
4265
4259
  }
4266
4260
 
4267
-
4268
4261
  /**
4269
4262
  * Build up the parameters in an object needed for a server-side processing
4270
4263
  * request.
@@ -4272,22 +4265,18 @@ function _fnAjaxUpdate( settings )
4272
4265
  * @returns {bool} block the table drawing or not
4273
4266
  * @memberof DataTable#oApi
4274
4267
  */
4275
- function _fnAjaxParameters( settings )
4276
- {
4277
- var
4278
- columns = settings.aoColumns,
4268
+ function _fnAjaxParameters(settings) {
4269
+ var columns = settings.aoColumns,
4279
4270
  features = settings.oFeatures,
4280
4271
  preSearch = settings.oPreviousSearch,
4281
4272
  preColSearch = settings.aoPreSearchCols,
4282
- colData = function ( idx, prop ) {
4283
- return typeof columns[idx][prop] === 'function' ?
4284
- 'function' :
4285
- columns[idx][prop];
4273
+ colData = function (idx, prop) {
4274
+ return typeof columns[idx][prop] === 'function' ? 'function' : columns[idx][prop];
4286
4275
  };
4287
4276
 
4288
4277
  return {
4289
4278
  draw: settings.iDraw,
4290
- columns: columns.map( function ( column, i ) {
4279
+ columns: columns.map(function (column, i) {
4291
4280
  return {
4292
4281
  data: colData(i, 'mData'),
4293
4282
  name: column.sName,
@@ -4296,40 +4285,43 @@ function _fnAjaxParameters( settings )
4296
4285
  search: {
4297
4286
  value: preColSearch[i].search,
4298
4287
  regex: preColSearch[i].regex,
4299
- fixed: Object.keys(column.searchFixed).map( function(name) {
4300
- return {
4301
- name: name,
4302
- term: column.searchFixed[name].toString()
4303
- }
4304
- })
4288
+ fixed: Object.keys(column.searchFixed)
4289
+ .map(function (name) {
4290
+ return {
4291
+ name: name,
4292
+ term: typeof column.searchFixed[name] !== 'function'
4293
+ ? column.searchFixed[name].toString()
4294
+ : 'function'
4295
+ };
4296
+ })
4305
4297
  }
4306
4298
  };
4307
- } ),
4308
- order: _fnSortFlatten( settings ).map( function ( val ) {
4299
+ }),
4300
+ order: _fnSortFlatten(settings).map(function (val) {
4309
4301
  return {
4310
4302
  column: val.col,
4311
4303
  dir: val.dir,
4312
4304
  name: colData(val.col, 'sName')
4313
4305
  };
4314
- } ),
4306
+ }),
4315
4307
  start: settings._iDisplayStart,
4316
- length: features.bPaginate ?
4317
- settings._iDisplayLength :
4318
- -1,
4308
+ length: features.bPaginate ? settings._iDisplayLength : -1,
4319
4309
  search: {
4320
4310
  value: preSearch.search,
4321
4311
  regex: preSearch.regex,
4322
- fixed: Object.keys(settings.searchFixed).map( function(name) {
4323
- return {
4324
- name: name,
4325
- term: settings.searchFixed[name].toString()
4326
- }
4327
- })
4312
+ fixed: Object.keys(settings.searchFixed)
4313
+ .map(function (name) {
4314
+ return {
4315
+ name: name,
4316
+ term: typeof settings.searchFixed[name] !== 'function'
4317
+ ? settings.searchFixed[name].toString()
4318
+ : 'function'
4319
+ };
4320
+ })
4328
4321
  }
4329
4322
  };
4330
4323
  }
4331
4324
 
4332
-
4333
4325
  /**
4334
4326
  * Data the data from the server (nuking the old) and redraw the table
4335
4327
  * @param {object} oSettings dataTables settings object
@@ -4341,42 +4333,40 @@ function _fnAjaxParameters( settings )
4341
4333
  * @param {string} [json.sColumns] Column ordering (sName, comma separated)
4342
4334
  * @memberof DataTable#oApi
4343
4335
  */
4344
- function _fnAjaxUpdateDraw ( settings, json )
4345
- {
4336
+ function _fnAjaxUpdateDraw(settings, json) {
4346
4337
  var data = _fnAjaxDataSrc(settings, json);
4347
4338
  var draw = _fnAjaxDataSrcParam(settings, 'draw', json);
4348
4339
  var recordsTotal = _fnAjaxDataSrcParam(settings, 'recordsTotal', json);
4349
4340
  var recordsFiltered = _fnAjaxDataSrcParam(settings, 'recordsFiltered', json);
4350
4341
 
4351
- if ( draw !== undefined ) {
4342
+ if (draw !== undefined) {
4352
4343
  // Protect against out of sequence returns
4353
- if ( draw*1 < settings.iDraw ) {
4344
+ if (draw * 1 < settings.iDraw) {
4354
4345
  return;
4355
4346
  }
4356
4347
  settings.iDraw = draw * 1;
4357
4348
  }
4358
4349
 
4359
4350
  // No data in returned object, so rather than an array, we show an empty table
4360
- if ( ! data ) {
4351
+ if (!data) {
4361
4352
  data = [];
4362
4353
  }
4363
4354
 
4364
- _fnClearTable( settings );
4365
- settings._iRecordsTotal = parseInt(recordsTotal, 10);
4355
+ _fnClearTable(settings);
4356
+ settings._iRecordsTotal = parseInt(recordsTotal, 10);
4366
4357
  settings._iRecordsDisplay = parseInt(recordsFiltered, 10);
4367
4358
 
4368
- for ( var i=0, ien=data.length ; i<ien ; i++ ) {
4369
- _fnAddData( settings, data[i] );
4359
+ for (var i = 0, iLen = data.length; i < iLen; i++) {
4360
+ _fnAddData(settings, data[i]);
4370
4361
  }
4371
4362
  settings.aiDisplay = settings.aiDisplayMaster.slice();
4372
4363
 
4373
4364
  _fnColumnTypes(settings);
4374
- _fnDraw( settings, true );
4375
- _fnInitComplete( settings );
4376
- _fnProcessingDisplay( settings, false );
4365
+ _fnDraw(settings, true);
4366
+ _fnInitComplete(settings);
4367
+ _fnProcessingDisplay(settings, false);
4377
4368
  }
4378
4369
 
4379
-
4380
4370
  /**
4381
4371
  * Get the data from the JSON data source to use for drawing a table. Using
4382
4372
  * `_fnGetObjectDataFn` allows the data to be sourced from a property of the
@@ -4385,11 +4375,10 @@ function _fnAjaxUpdateDraw ( settings, json )
4385
4375
  * @param {object} json Data source object / array from the server
4386
4376
  * @return {array} Array of data to use
4387
4377
  */
4388
- function _fnAjaxDataSrc ( settings, json, write )
4389
- {
4378
+ function _fnAjaxDataSrc(settings, json, write) {
4390
4379
  var dataProp = 'data';
4391
4380
 
4392
- if ($.isPlainObject( settings.ajax ) && settings.ajax.dataSrc !== undefined) {
4381
+ if ($.isPlainObject(settings.ajax) && settings.ajax.dataSrc !== undefined) {
4393
4382
  // Could in inside a `dataSrc` object, or not!
4394
4383
  var dataSrc = settings.ajax.dataSrc;
4395
4384
 
@@ -4402,20 +4391,18 @@ function _fnAjaxDataSrc ( settings, json, write )
4402
4391
  }
4403
4392
  }
4404
4393
 
4405
- if ( ! write ) {
4406
- if ( dataProp === 'data' ) {
4394
+ if (!write) {
4395
+ if (dataProp === 'data') {
4407
4396
  // If the default, then we still want to support the old style, and safely ignore
4408
4397
  // it if possible
4409
4398
  return json.aaData || json[dataProp];
4410
4399
  }
4411
4400
 
4412
- return dataProp !== "" ?
4413
- _fnGetObjectDataFn( dataProp )( json ) :
4414
- json;
4401
+ return dataProp !== '' ? _fnGetObjectDataFn(dataProp)(json) : json;
4415
4402
  }
4416
-
4403
+
4417
4404
  // set
4418
- _fnSetObjectDataFn( dataProp )( json, write );
4405
+ _fnSetObjectDataFn(dataProp)(json, write);
4419
4406
  }
4420
4407
 
4421
4408
  /**
@@ -4425,14 +4412,12 @@ function _fnAjaxDataSrc ( settings, json, write )
4425
4412
  * @param {*} json JSON data
4426
4413
  * @returns Resolved value
4427
4414
  */
4428
- function _fnAjaxDataSrcParam (settings, param, json) {
4429
- var dataSrc = $.isPlainObject( settings.ajax )
4430
- ? settings.ajax.dataSrc
4431
- : null;
4415
+ function _fnAjaxDataSrcParam(settings, param, json) {
4416
+ var dataSrc = $.isPlainObject(settings.ajax) ? settings.ajax.dataSrc : null;
4432
4417
 
4433
4418
  if (dataSrc && dataSrc[param]) {
4434
4419
  // Get from custom location
4435
- return _fnGetObjectDataFn( dataSrc[param] )( json );
4420
+ return _fnGetObjectDataFn(dataSrc[param])(json);
4436
4421
  }
4437
4422
 
4438
4423
  // else - Default behaviour
@@ -4449,9 +4434,7 @@ function _fnAjaxDataSrcParam (settings, param, json) {
4449
4434
  old = 'iTotalDisplayRecords';
4450
4435
  }
4451
4436
 
4452
- return json[old] !== undefined
4453
- ? json[old]
4454
- : json[param];
4437
+ return json[old] !== undefined ? json[old] : json[param];
4455
4438
  }
4456
4439
 
4457
4440
 
@@ -4524,7 +4507,7 @@ function _fnFilterCustom( settings )
4524
4507
  var displayRows = settings.aiDisplay;
4525
4508
  var row, rowIdx;
4526
4509
 
4527
- for ( var i=0, ien=filters.length ; i<ien ; i++ ) {
4510
+ for ( var i=0, iLen=filters.length ; i<iLen ; i++ ) {
4528
4511
  var rows = [];
4529
4512
 
4530
4513
  // Loop over each row and see if it should be included
@@ -4592,7 +4575,7 @@ function _fnFilter( searchRows, settings, input, options, column )
4592
4575
  * @param {string} sSearch string to search for
4593
4576
  * @param {bool} bRegex treat as a regular expression or not
4594
4577
  * @param {bool} bSmart perform smart filtering or not
4595
- * @param {bool} bCaseInsensitive Do case insensitive matching or not
4578
+ * @param {bool} bCaseInsensitive Do case-insensitive matching or not
4596
4579
  * @returns {RegExp} constructed object
4597
4580
  * @memberof DataTable#oApi
4598
4581
  */
@@ -5335,7 +5318,7 @@ function _fnScrollDraw ( settings )
5335
5318
  }
5336
5319
 
5337
5320
  // 4. Clean up
5338
- // Figure out if there are scrollbar present - if so then we need a the header and footer to
5321
+ // Figure out if there are scrollbar present - if so then we need the header and footer to
5339
5322
  // provide a bit more space to allow "overflow" scrolling (i.e. past the scrollbar)
5340
5323
  var isScrolling = Math.floor(table.height()) > divBodyEl.clientHeight || divBody.css('overflow-y') == "scroll";
5341
5324
  var paddingSide = 'padding' + (browser.bScrollbarLeft ? 'Left' : 'Right' );
@@ -5433,7 +5416,7 @@ function _fnCalculateColumnWidths ( settings )
5433
5416
  .removeAttr( 'id' );
5434
5417
 
5435
5418
  // Clean up the table body
5436
- tmpTable.append('<tbody>')
5419
+ tmpTable.append('<tbody/>')
5437
5420
  var tr = $('<tr/>').appendTo( tmpTable.find('tbody') );
5438
5421
 
5439
5422
  // Clone the table header and footer - we can't use the header / footer
@@ -5642,7 +5625,7 @@ function _fnGetMaxLenString( settings, colIdx )
5642
5625
  if (! column.maxLenString) {
5643
5626
  var s, max='', maxLen = -1;
5644
5627
 
5645
- for ( var i=0, ien=settings.aiDisplayMaster.length ; i<ien ; i++ ) {
5628
+ for ( var i=0, iLen=settings.aiDisplayMaster.length ; i<iLen ; i++ ) {
5646
5629
  var rowIdx = settings.aiDisplayMaster[i];
5647
5630
  var data = _fnGetRowDisplay(settings, rowIdx)[colIdx];
5648
5631
 
@@ -5764,7 +5747,7 @@ function _fnSortAttachListener(settings, node, selector, column, callback) {
5764
5747
  : [column];
5765
5748
 
5766
5749
  if ( columns.length ) {
5767
- for ( var i=0, ien=columns.length ; i<ien ; i++ ) {
5750
+ for ( var i=0, iLen=columns.length ; i<iLen ; i++ ) {
5768
5751
  var ret = _fnSortAdd( settings, columns[i], i, e.shiftKey );
5769
5752
 
5770
5753
  if (ret !== false) {
@@ -5813,7 +5796,7 @@ function _fnSortDisplay(settings, display) {
5813
5796
  masterMap[master[i]] = i;
5814
5797
  }
5815
5798
 
5816
- // And then cache what would be the indexOf fom the display
5799
+ // And then cache what would be the indexOf from the display
5817
5800
  for (i=0 ; i<display.length ; i++) {
5818
5801
  map[display[i]] = masterMap[display[i]];
5819
5802
  }
@@ -5939,7 +5922,7 @@ function _fnSortFlatten ( settings )
5939
5922
  function _fnSort ( oSettings, col, dir )
5940
5923
  {
5941
5924
  var
5942
- i, ien, iLen,
5925
+ i, iLen,
5943
5926
  aiOrig = [],
5944
5927
  extSort = DataTable.ext.type.order,
5945
5928
  aoData = oSettings.aoData,
@@ -5970,7 +5953,7 @@ function _fnSort ( oSettings, col, dir )
5970
5953
  aSort = _fnSortFlatten( oSettings );
5971
5954
  }
5972
5955
 
5973
- for ( i=0, ien=aSort.length ; i<ien ; i++ ) {
5956
+ for ( i=0, iLen=aSort.length ; i<iLen ; i++ ) {
5974
5957
  sortCol = aSort[i];
5975
5958
 
5976
5959
  // Load the data needed for the sort, for each cell
@@ -5993,7 +5976,7 @@ function _fnSort ( oSettings, col, dir )
5993
5976
 
5994
5977
  /* Do the sort - here we want multi-column sorting based on a given data source (column)
5995
5978
  * and sorting function (from oSort) in a certain direction. It's reasonably complex to
5996
- * follow on it's own, but this is what we want (example two column sorting):
5979
+ * follow on its own, but this is what we want (example two column sorting):
5997
5980
  * fnLocalSorting = function(a,b){
5998
5981
  * var test;
5999
5982
  * test = oSort['string-asc']('data11', 'data12');
@@ -6117,7 +6100,7 @@ function _fnSortAdd ( settings, colIdx, addIndex, shift )
6117
6100
  nextSortIdx = 0; // can't remove sorting completely
6118
6101
  }
6119
6102
 
6120
- if ( nextSortIdx === null ) {
6103
+ if ( nextSortIdx === null || asSorting[ nextSortIdx ] === '' ) {
6121
6104
  sorting.splice( sortIdx, 1 );
6122
6105
  }
6123
6106
  else {
@@ -6167,11 +6150,11 @@ function _fnSortingClasses( settings )
6167
6150
  var sortClass = settings.oClasses.order.position;
6168
6151
  var sort = _fnSortFlatten( settings );
6169
6152
  var features = settings.oFeatures;
6170
- var i, ien, colIdx;
6153
+ var i, iLen, colIdx;
6171
6154
 
6172
6155
  if ( features.bSort && features.bSortClasses ) {
6173
6156
  // Remove old sorting classes
6174
- for ( i=0, ien=oldSort.length ; i<ien ; i++ ) {
6157
+ for ( i=0, iLen=oldSort.length ; i<iLen ; i++ ) {
6175
6158
  colIdx = oldSort[i].src;
6176
6159
 
6177
6160
  // Remove column sorting
@@ -6180,7 +6163,7 @@ function _fnSortingClasses( settings )
6180
6163
  }
6181
6164
 
6182
6165
  // Add new column sorting
6183
- for ( i=0, ien=sort.length ; i<ien ; i++ ) {
6166
+ for ( i=0, iLen=sort.length ; i<iLen ; i++ ) {
6184
6167
  colIdx = sort[i].src;
6185
6168
 
6186
6169
  $( _pluck( settings.aoData, 'anCells', colIdx ) )
@@ -6314,7 +6297,7 @@ function _fnLoadState ( settings, init, callback )
6314
6297
  }
6315
6298
 
6316
6299
  function _fnImplementState ( settings, s, callback) {
6317
- var i, ien;
6300
+ var i, iLen;
6318
6301
  var columns = settings.aoColumns;
6319
6302
  var currentNames = _pluck(settings.aoColumns, 'sName');
6320
6303
 
@@ -6443,7 +6426,7 @@ function _fnImplementState ( settings, s, callback) {
6443
6426
 
6444
6427
  // If the number of columns to restore is different from current, then all bets are off.
6445
6428
  if (set.length === columns.length) {
6446
- for ( i=0, ien=set.length ; i<ien ; i++ ) {
6429
+ for ( i=0, iLen=set.length ; i<iLen ; i++ ) {
6447
6430
  var col = set[i];
6448
6431
 
6449
6432
  // Visibility
@@ -6466,7 +6449,9 @@ function _fnImplementState ( settings, s, callback) {
6466
6449
 
6467
6450
  // If the api is defined then we need to adjust the columns once the visibility has been changed
6468
6451
  if (api) {
6469
- api.columns.adjust();
6452
+ api.one('draw', function () {
6453
+ api.columns.adjust();
6454
+ });
6470
6455
  }
6471
6456
  }
6472
6457
  }
@@ -6597,7 +6582,7 @@ function _fnExtend( out, extender, breakRefs )
6597
6582
 
6598
6583
 
6599
6584
  /**
6600
- * Bind an event handers to allow a click or return key to activate the callback.
6585
+ * Bind an event handler to allow a click or return key to activate the callback.
6601
6586
  * This is good for accessibility since a return on the keyboard will have the
6602
6587
  * same effect as a click, if the element has focus.
6603
6588
  * @param {element} n Element to bind the action to
@@ -6786,7 +6771,7 @@ function _fnMacros ( settings, str, entries )
6786
6771
  }
6787
6772
 
6788
6773
  /**
6789
- * Add elements to an array as quickly as possible, but stack stafe.
6774
+ * Add elements to an array as quickly as possible, but stack safe.
6790
6775
  *
6791
6776
  * @param {*} arr Array to add the data to
6792
6777
  * @param {*} data Data array that is to be added
@@ -7062,7 +7047,7 @@ $.extend( _Api.prototype, {
7062
7047
 
7063
7048
  each: function ( fn )
7064
7049
  {
7065
- for ( var i=0, ien=this.length ; i<ien; i++ ) {
7050
+ for ( var i=0, iLen=this.length ; i<iLen; i++ ) {
7066
7051
  fn.call( this, this[i], i, this );
7067
7052
  }
7068
7053
 
@@ -7108,7 +7093,7 @@ $.extend( _Api.prototype, {
7108
7093
  iterator: function ( flatten, type, fn, alwaysNew ) {
7109
7094
  var
7110
7095
  a = [], ret,
7111
- i, ien, j, jen,
7096
+ i, iLen, j, jen,
7112
7097
  context = this.context,
7113
7098
  rows, items, item,
7114
7099
  selector = this.selector;
@@ -7121,7 +7106,7 @@ $.extend( _Api.prototype, {
7121
7106
  flatten = false;
7122
7107
  }
7123
7108
 
7124
- for ( i=0, ien=context.length ; i<ien ; i++ ) {
7109
+ for ( i=0, iLen=context.length ; i<iLen ; i++ ) {
7125
7110
  var apiInst = new _Api( context[i] );
7126
7111
 
7127
7112
  if ( type === 'table' ) {
@@ -7243,18 +7228,18 @@ $.extend( _Api.prototype, {
7243
7228
  } );
7244
7229
 
7245
7230
 
7246
- function _api_scope( scope, fn, struc ) {
7231
+ function _api_scope( scope, fn, struct ) {
7247
7232
  return function () {
7248
7233
  var ret = fn.apply( scope || this, arguments );
7249
7234
 
7250
7235
  // Method extension
7251
- _Api.extend( ret, ret, struc.methodExt );
7236
+ _Api.extend( ret, ret, struct.methodExt );
7252
7237
  return ret;
7253
7238
  };
7254
7239
  }
7255
7240
 
7256
7241
  function _api_find( src, name ) {
7257
- for ( var i=0, ien=src.length ; i<ien ; i++ ) {
7242
+ for ( var i=0, iLen=src.length ; i<iLen ; i++ ) {
7258
7243
  if ( src[i].name === name ) {
7259
7244
  return src[i];
7260
7245
  }
@@ -7272,10 +7257,10 @@ _Api.extend = function ( scope, obj, ext )
7272
7257
  }
7273
7258
 
7274
7259
  var
7275
- i, ien,
7260
+ i, iLen,
7276
7261
  struct;
7277
7262
 
7278
- for ( i=0, ien=ext.length ; i<ien ; i++ ) {
7263
+ for ( i=0, iLen=ext.length ; i<iLen ; i++ ) {
7279
7264
  struct = ext[i];
7280
7265
 
7281
7266
  if (struct.name === '__proto__') {
@@ -7330,12 +7315,12 @@ _Api.register = _api_register = function ( name, val )
7330
7315
  }
7331
7316
 
7332
7317
  var
7333
- i, ien,
7318
+ i, iLen,
7334
7319
  heir = name.split('.'),
7335
7320
  struct = __apiStruct,
7336
7321
  key, method;
7337
7322
 
7338
- for ( i=0, ien=heir.length ; i<ien ; i++ ) {
7323
+ for ( i=0, iLen=heir.length ; i<iLen ; i++ ) {
7339
7324
  method = heir[i].indexOf('()') !== -1;
7340
7325
  key = method ?
7341
7326
  heir[i].replace('()', '') :
@@ -7353,7 +7338,7 @@ _Api.register = _api_register = function ( name, val )
7353
7338
  struct.push( src );
7354
7339
  }
7355
7340
 
7356
- if ( i === ien-1 ) {
7341
+ if ( i === iLen-1 ) {
7357
7342
  src.val = val;
7358
7343
  src.type = typeof val === 'function' ?
7359
7344
  'function' :
@@ -7695,7 +7680,7 @@ _api_register( 'page.info()', function () {
7695
7680
  */
7696
7681
  _api_register( 'page.len()', function ( len ) {
7697
7682
  // Note that we can't call this function 'length()' because `length`
7698
- // is a Javascript property of functions which defines how many arguments
7683
+ // is a JavaScript property of functions which defines how many arguments
7699
7684
  // the function expects.
7700
7685
  if ( len === undefined ) {
7701
7686
  return this.context.length !== 0 ?
@@ -7738,7 +7723,7 @@ var __reload = function ( settings, holdPosition, callback ) {
7738
7723
  _fnClearTable( settings );
7739
7724
 
7740
7725
  var data = _fnAjaxDataSrc( settings, json );
7741
- for ( var i=0, ien=data.length ; i<ien ; i++ ) {
7726
+ for ( var i=0, iLen=data.length ; i<iLen ; i++ ) {
7742
7727
  _fnAddData( settings, data[i] );
7743
7728
  }
7744
7729
 
@@ -7861,7 +7846,7 @@ var _selector_run = function ( type, selector, selectFn, settings, opts )
7861
7846
  {
7862
7847
  var
7863
7848
  out = [], res,
7864
- i, ien,
7849
+ i, iLen,
7865
7850
  selectorType = typeof selector;
7866
7851
 
7867
7852
  // Can't just check for isArray here, as an API or jQuery instance might be
@@ -7870,7 +7855,7 @@ var _selector_run = function ( type, selector, selectFn, settings, opts )
7870
7855
  selector = [ selector ];
7871
7856
  }
7872
7857
 
7873
- for ( i=0, ien=selector.length ; i<ien ; i++ ) {
7858
+ for ( i=0, iLen=selector.length ; i<iLen ; i++ ) {
7874
7859
  res = selectFn( typeof selector[i] === 'string' ? selector[i].trim() : selector[i] );
7875
7860
 
7876
7861
  // Remove empty items
@@ -7886,7 +7871,7 @@ var _selector_run = function ( type, selector, selectFn, settings, opts )
7886
7871
  // selector extensions
7887
7872
  var ext = _ext.selector[ type ];
7888
7873
  if ( ext.length ) {
7889
- for ( i=0, ien=ext.length ; i<ien ; i++ ) {
7874
+ for ( i=0, iLen=ext.length ; i<iLen ; i++ ) {
7890
7875
  out = ext[i]( settings, opts, out );
7891
7876
  }
7892
7877
  }
@@ -7941,7 +7926,7 @@ var _selector_first = function ( old )
7941
7926
  var _selector_row_indexes = function ( settings, opts )
7942
7927
  {
7943
7928
  var
7944
- i, ien, tmp, a=[],
7929
+ i, iLen, tmp, a=[],
7945
7930
  displayFiltered = settings.aiDisplay,
7946
7931
  displayMaster = settings.aiDisplayMaster;
7947
7932
 
@@ -7964,7 +7949,7 @@ var _selector_row_indexes = function ( settings, opts )
7964
7949
  // Current page implies that order=current and filter=applied, since it is
7965
7950
  // fairly senseless otherwise, regardless of what order and search actually
7966
7951
  // are
7967
- for ( i=settings._iDisplayStart, ien=settings.fnDisplayEnd() ; i<ien ; i++ ) {
7952
+ for ( i=settings._iDisplayStart, iLen=settings.fnDisplayEnd() ; i<iLen ; i++ ) {
7968
7953
  a.push( displayFiltered[i] );
7969
7954
  }
7970
7955
  }
@@ -7979,7 +7964,7 @@ var _selector_row_indexes = function ( settings, opts )
7979
7964
  // O(n+m) solution by creating a hash map
7980
7965
  var displayFilteredMap = {};
7981
7966
 
7982
- for ( i=0, ien=displayFiltered.length ; i<ien ; i++ ) {
7967
+ for ( i=0, iLen=displayFiltered.length ; i<iLen ; i++ ) {
7983
7968
  displayFilteredMap[displayFiltered[i]] = null;
7984
7969
  }
7985
7970
 
@@ -7991,7 +7976,7 @@ var _selector_row_indexes = function ( settings, opts )
7991
7976
  }
7992
7977
  }
7993
7978
  else if ( order == 'index' || order == 'original' ) {
7994
- for ( i=0, ien=settings.aoData.length ; i<ien ; i++ ) {
7979
+ for ( i=0, iLen=settings.aoData.length ; i<iLen ; i++ ) {
7995
7980
  if (! settings.aoData[i]) {
7996
7981
  continue;
7997
7982
  }
@@ -8208,7 +8193,7 @@ _api_registerPlural( 'rows().ids()', 'row().id()', function ( hash ) {
8208
8193
  var context = this.context;
8209
8194
 
8210
8195
  // `iterator` will drop undefined values, but in this case we want them
8211
- for ( var i=0, ien=context.length ; i<ien ; i++ ) {
8196
+ for ( var i=0, iLen=context.length ; i<iLen ; i++ ) {
8212
8197
  for ( var j=0, jen=this[i].length ; j<jen ; j++ ) {
8213
8198
  var id = context[i].rowIdFn( context[i].aoData[ this[i][j] ]._aData );
8214
8199
  a.push( (hash === true ? '#' : '' )+ id );
@@ -8252,10 +8237,10 @@ _api_registerPlural( 'rows().remove()', 'row().remove()', function () {
8252
8237
 
8253
8238
  _api_register( 'rows.add()', function ( rows ) {
8254
8239
  var newRows = this.iterator( 'table', function ( settings ) {
8255
- var row, i, ien;
8240
+ var row, i, iLen;
8256
8241
  var out = [];
8257
8242
 
8258
- for ( i=0, ien=rows.length ; i<ien ; i++ ) {
8243
+ for ( i=0, iLen=rows.length ; i<iLen ; i++ ) {
8259
8244
  row = rows[i];
8260
8245
 
8261
8246
  if ( row.nodeName && row.nodeName.toUpperCase() === 'TR' ) {
@@ -8402,7 +8387,7 @@ var __details_add = function ( ctx, row, data, klass )
8402
8387
  var addRow = function ( r, k ) {
8403
8388
  // Recursion to allow for arrays of jQuery objects
8404
8389
  if ( Array.isArray( r ) || r instanceof $ ) {
8405
- for ( var i=0, ien=r.length ; i<ien ; i++ ) {
8390
+ for ( var i=0, iLen=r.length ; i<iLen ; i++ ) {
8406
8391
  addRow( r[i], k );
8407
8392
  }
8408
8393
  return;
@@ -8422,7 +8407,7 @@ var __details_add = function ( ctx, row, data, klass )
8422
8407
 
8423
8408
  $('td', created)
8424
8409
  .addClass( k )
8425
- .html( r )[0].colSpan = _fnVisbleColumns( ctx );
8410
+ .html( r )[0].colSpan = _fnVisibleColumns( ctx );
8426
8411
 
8427
8412
  rows.push( created[0] );
8428
8413
  }
@@ -8460,7 +8445,7 @@ var __details_remove = function ( api, idx )
8460
8445
  var row = ctx[0].aoData[ idx !== undefined ? idx : api[0] ];
8461
8446
 
8462
8447
  if ( row && row._details ) {
8463
- row._details.remove();
8448
+ row._details.detach();
8464
8449
 
8465
8450
  row._detailsShow = undefined;
8466
8451
  row._details = undefined;
@@ -8534,9 +8519,9 @@ var __details_events = function ( settings )
8534
8519
 
8535
8520
  // Update the colspan for the details rows (note, only if it already has
8536
8521
  // a colspan)
8537
- var row, visible = _fnVisbleColumns( ctx );
8522
+ var row, visible = _fnVisibleColumns( ctx );
8538
8523
 
8539
- for ( var i=0, ien=data.length ; i<ien ; i++ ) {
8524
+ for ( var i=0, iLen=data.length ; i<iLen ; i++ ) {
8540
8525
  row = data[i];
8541
8526
 
8542
8527
  if ( row && row._details ) {
@@ -8557,7 +8542,7 @@ var __details_events = function ( settings )
8557
8542
  return;
8558
8543
  }
8559
8544
 
8560
- for ( var i=0, ien=data.length ; i<ien ; i++ ) {
8545
+ for ( var i=0, iLen=data.length ; i<iLen ; i++ ) {
8561
8546
  if ( data[i] && data[i]._details ) {
8562
8547
  __details_remove( api, i );
8563
8548
  }
@@ -8661,7 +8646,7 @@ var __re_column_selector = /^([^:]+)?:(name|title|visIdx|visible)$/;
8661
8646
  // iterator callback in columns().data()
8662
8647
  var __columnData = function ( settings, column, r1, r2, rows, type ) {
8663
8648
  var a = [];
8664
- for ( var row=0, ien=rows.length ; row<ien ; row++ ) {
8649
+ for ( var row=0, iLen=rows.length ; row<iLen ; row++ ) {
8665
8650
  a.push( _fnGetCellData( settings, rows[row], column, type ) );
8666
8651
  }
8667
8652
  return a;
@@ -8861,7 +8846,7 @@ var __setColumnVis = function ( settings, column, vis ) {
8861
8846
  cols = settings.aoColumns,
8862
8847
  col = cols[ column ],
8863
8848
  data = settings.aoData,
8864
- cells, i, ien, tr;
8849
+ cells, i, iLen, tr;
8865
8850
 
8866
8851
  // Get
8867
8852
  if ( vis === undefined ) {
@@ -8879,7 +8864,7 @@ var __setColumnVis = function ( settings, column, vis ) {
8879
8864
  // Need to decide if we should use appendChild or insertBefore
8880
8865
  var insertBefore = _pluck(cols, 'bVisible').indexOf(true, column+1);
8881
8866
 
8882
- for ( i=0, ien=data.length ; i<ien ; i++ ) {
8867
+ for ( i=0, iLen=data.length ; i<iLen ; i++ ) {
8883
8868
  if (data[i]) {
8884
8869
  tr = data[i].nTr;
8885
8870
  cells = data[i].anCells;
@@ -9045,7 +9030,7 @@ _api_registerPlural( 'columns().visible()', 'column().visible()', function ( vis
9045
9030
  // Update colspan for no records display. Child rows and extensions will use their own
9046
9031
  // listeners to do this - only need to update the empty table item here
9047
9032
  if ( ! settings.aiDisplay.length ) {
9048
- $(settings.nTBody).find('td[colspan]').attr('colspan', _fnVisbleColumns(settings));
9033
+ $(settings.nTBody).find('td[colspan]').attr('colspan', _fnVisibleColumns(settings));
9049
9034
  }
9050
9035
 
9051
9036
  _fnSaveState( settings );
@@ -9131,7 +9116,7 @@ var __cell_selector = function ( settings, selector, opts )
9131
9116
  var allCells = $(_flatten( [], cells ));
9132
9117
  var row;
9133
9118
  var columns = settings.aoColumns.length;
9134
- var a, i, ien, j, o, host;
9119
+ var a, i, iLen, j, o, host;
9135
9120
 
9136
9121
  var run = function ( s ) {
9137
9122
  var fnSelector = typeof s === 'function';
@@ -9140,7 +9125,7 @@ var __cell_selector = function ( settings, selector, opts )
9140
9125
  // All cells and function selectors
9141
9126
  a = [];
9142
9127
 
9143
- for ( i=0, ien=rows.length ; i<ien ; i++ ) {
9128
+ for ( i=0, iLen=rows.length ; i<iLen ; i++ ) {
9144
9129
  row = rows[i];
9145
9130
 
9146
9131
  for ( j=0 ; j<columns ; j++ ) {
@@ -9245,12 +9230,12 @@ _api_register( 'cells()', function ( rowSelector, columnSelector, opts ) {
9245
9230
  // Row + column selector
9246
9231
  var columns = this.columns( columnSelector, internalOpts );
9247
9232
  var rows = this.rows( rowSelector, internalOpts );
9248
- var i, ien, j, jen;
9233
+ var i, iLen, j, jen;
9249
9234
 
9250
9235
  var cellsNoOpts = this.iterator( 'table', function ( settings, idx ) {
9251
9236
  var a = [];
9252
9237
 
9253
- for ( i=0, ien=rows[idx].length ; i<ien ; i++ ) {
9238
+ for ( i=0, iLen=rows[idx].length ; i<iLen ; i++ ) {
9254
9239
  for ( j=0, jen=columns[idx].length ; j<jen ; j++ ) {
9255
9240
  a.push( {
9256
9241
  row: rows[idx][i],
@@ -9462,7 +9447,7 @@ _api_register( [
9462
9447
  return this.iterator( 'column', function ( settings, idx ) {
9463
9448
  var sort = _fnSortFlatten( settings );
9464
9449
 
9465
- for ( var i=0, ien=sort.length ; i<ien ; i++ ) {
9450
+ for ( var i=0, iLen=sort.length ; i<iLen ; i++ ) {
9466
9451
  if ( sort[i].col === idx ) {
9467
9452
  return sort[i].dir;
9468
9453
  }
@@ -10153,9 +10138,11 @@ _api_register( 'i18n()', function ( token, def, plural ) {
10153
10138
  }
10154
10139
 
10155
10140
  if ( $.isPlainObject( resolved ) ) {
10156
- resolved = plural !== undefined && resolved[ plural ] !== undefined ?
10157
- resolved[ plural ] :
10158
- resolved._;
10141
+ resolved = plural !== undefined && resolved[ plural ] !== undefined
10142
+ ? resolved[ plural ]
10143
+ : plural === false
10144
+ ? resolved
10145
+ : resolved._;
10159
10146
  }
10160
10147
 
10161
10148
  return typeof resolved === 'string'
@@ -10184,7 +10171,7 @@ function cleanHeader(node, className) {
10184
10171
  * @type string
10185
10172
  * @default Version number
10186
10173
  */
10187
- DataTable.version = "2.3.2";
10174
+ DataTable.version = "2.3.4";
10188
10175
 
10189
10176
  /**
10190
10177
  * Private data store, containing all of the settings objects that are
@@ -10217,7 +10204,7 @@ DataTable.models = {};
10217
10204
  */
10218
10205
  DataTable.models.oSearch = {
10219
10206
  /**
10220
- * Flag to indicate if the filtering should be case insensitive or not
10207
+ * Flag to whether or not the filtering should be case-insensitive
10221
10208
  */
10222
10209
  "caseInsensitive": true,
10223
10210
 
@@ -10502,7 +10489,7 @@ DataTable.models.oColumn = {
10502
10489
  * from v1.10 onwards the primary interface is camel case. In order to avoid
10503
10490
  * breaking backwards compatibility utterly with this change, the Hungarian
10504
10491
  * version is still, internally the primary interface, but is is not documented
10505
- * - hence the @name tags in each doc comment. This allows a Javascript function
10492
+ * - hence the @name tags in each doc comment. This allows a JavaScript function
10506
10493
  * to create a map from Hungarian notation to camel case (going the other direction
10507
10494
  * would require each property to be listed, which would add around 3K to the size
10508
10495
  * of DataTables, while this method is about a 0.5K hit).
@@ -10521,7 +10508,7 @@ DataTable.defaults = {
10521
10508
  /**
10522
10509
  * An array of data to use for the table, passed in at initialisation which
10523
10510
  * will be used in preference to any data which is already in the DOM. This is
10524
- * particularly useful for constructing tables purely in Javascript, for
10511
+ * particularly useful for constructing tables purely in JavaScript, for
10525
10512
  * example with a custom Ajax call.
10526
10513
  */
10527
10514
  "aaData": null,
@@ -10588,7 +10575,7 @@ DataTable.defaults = {
10588
10575
  * * `dataSrc` - By default DataTables will look for the property `data` (or
10589
10576
  * `aaData` for compatibility with DataTables 1.9-) when obtaining data
10590
10577
  * from an Ajax source or for server-side processing - this parameter
10591
- * allows that property to be changed. You can use Javascript dotted
10578
+ * allows that property to be changed. You can use JavaScript dotted
10592
10579
  * object notation to get a data source for multiple levels of nesting, or
10593
10580
  * it my be used as a function. As a function it takes a single parameter,
10594
10581
  * the JSON returned from the server, which can be manipulated as
@@ -10712,13 +10699,13 @@ DataTable.defaults = {
10712
10699
  "bFilter": true,
10713
10700
 
10714
10701
  /**
10715
- * Used only for compatiblity with DT1
10702
+ * Used only for compatibility with DT1
10716
10703
  * @deprecated
10717
10704
  */
10718
10705
  "bInfo": true,
10719
10706
 
10720
10707
  /**
10721
- * Used only for compatiblity with DT1
10708
+ * Used only for compatibility with DT1
10722
10709
  * @deprecated
10723
10710
  */
10724
10711
  "bLengthChange": true,
@@ -10809,7 +10796,7 @@ DataTable.defaults = {
10809
10796
  * Enable or disable state saving. When enabled HTML5 `localStorage` will be
10810
10797
  * used to save table display information such as pagination information,
10811
10798
  * display length, filtering and sorting. As such when the end user reloads
10812
- * the page the display display will match what thy had previously set up.
10799
+ * the page the display will match what thy had previously set up.
10813
10800
  */
10814
10801
  "bStateSave": false,
10815
10802
 
@@ -11166,7 +11153,7 @@ DataTable.defaults = {
11166
11153
  /**
11167
11154
  * When using Ajax sourced data and during the first draw when DataTables is
11168
11155
  * gathering the data, this message is shown in an empty row in the table to
11169
- * indicate to the end user the the data is being loaded. Note that this
11156
+ * indicate to the end user the data is being loaded. Note that this
11170
11157
  * parameter is not used when loading data by server-side processing, just
11171
11158
  * Ajax sourced data with client-side processing.
11172
11159
  */
@@ -11427,8 +11414,8 @@ DataTable.defaults.column = {
11427
11414
  * * `string` - read an object property from the data source. There are
11428
11415
  * three 'special' options that can be used in the string to alter how
11429
11416
  * DataTables reads the data from the source object:
11430
- * * `.` - Dotted Javascript notation. Just as you use a `.` in
11431
- * Javascript to read from nested objects, so to can the options
11417
+ * * `.` - Dotted JavaScript notation. Just as you use a `.` in
11418
+ * JavaScript to read from nested objects, so to can the options
11432
11419
  * specified in `data`. For example: `browser.version` or
11433
11420
  * `browser.name`. If your object parameter name contains a period, use
11434
11421
  * `\\` to escape it - i.e. `first\\.name`.
@@ -11486,7 +11473,7 @@ DataTable.defaults.column = {
11486
11473
  * This property is the rendering partner to `data` and it is suggested that
11487
11474
  * when you want to manipulate data for display (including filtering,
11488
11475
  * sorting etc) without altering the underlying data for the table, use this
11489
- * property. `render` can be considered to be the the read only companion to
11476
+ * property. `render` can be considered to be the read only companion to
11490
11477
  * `data` which is read / write (then as such more complex). Like `data`
11491
11478
  * this option can be given in a number of different ways to effect its
11492
11479
  * behaviour:
@@ -11496,8 +11483,8 @@ DataTable.defaults.column = {
11496
11483
  * * `string` - read an object property from the data source. There are
11497
11484
  * three 'special' options that can be used in the string to alter how
11498
11485
  * DataTables reads the data from the source object:
11499
- * * `.` - Dotted Javascript notation. Just as you use a `.` in
11500
- * Javascript to read from nested objects, so to can the options
11486
+ * * `.` - Dotted JavaScript notation. Just as you use a `.` in
11487
+ * JavaScript to read from nested objects, so to can the options
11501
11488
  * specified in `data`. For example: `browser.version` or
11502
11489
  * `browser.name`. If your object parameter name contains a period, use
11503
11490
  * `\\` to escape it - i.e. `first\\.name`.
@@ -11600,7 +11587,7 @@ DataTable.defaults.column = {
11600
11587
  * The type allows you to specify how the data for this column will be
11601
11588
  * ordered. Four types (string, numeric, date and html (which will strip
11602
11589
  * HTML tags before ordering)) are currently available. Note that only date
11603
- * formats understood by Javascript's Date() object will be accepted as type
11590
+ * formats understood by JavaScript's Date() object will be accepted as type
11604
11591
  * date. For example: "Mar 26, 2008 5:03 PM". May take the values: 'string',
11605
11592
  * 'numeric', 'date' or 'html' (by default). Further types can be adding
11606
11593
  * through plug-ins.
@@ -11652,7 +11639,7 @@ DataTable.models.oSettings = {
11652
11639
  /**
11653
11640
  * Delay the creation of TR and TD elements until they are actually
11654
11641
  * needed by a driven page draw. This can give a significant speed
11655
- * increase for Ajax source and Javascript source data, but makes no
11642
+ * increase for Ajax source and JavaScript source data, but makes no
11656
11643
  * difference at all for DOM and server-side processing tables.
11657
11644
  * Note that this parameter will be set by the initialisation routine. To
11658
11645
  * set a default use {@link DataTable.defaults}.
@@ -11669,13 +11656,13 @@ DataTable.models.oSettings = {
11669
11656
  "bFilter": null,
11670
11657
 
11671
11658
  /**
11672
- * Used only for compatiblity with DT1
11659
+ * Used only for compatibility with DT1
11673
11660
  * @deprecated
11674
11661
  */
11675
11662
  "bInfo": true,
11676
11663
 
11677
11664
  /**
11678
- * Used only for compatiblity with DT1
11665
+ * Used only for compatibility with DT1
11679
11666
  * @deprecated
11680
11667
  */
11681
11668
  "bLengthChange": true,
@@ -12546,7 +12533,7 @@ function __mlHelper (localeString) {
12546
12533
  },
12547
12534
  order: {
12548
12535
  pre: function (d) {
12549
- // The renderer gives us Moment, Luxon or Date obects for the sorting, all of which have a
12536
+ // The renderer gives us Moment, Luxon or Date objects for the sorting, all of which have a
12550
12537
  // `valueOf` which gives milliseconds epoch
12551
12538
  return d.valueOf();
12552
12539
  }
@@ -12601,7 +12588,10 @@ function __mlHelper (localeString) {
12601
12588
  }
12602
12589
 
12603
12590
  var formatted = to === null
12604
- ? __mld(dt, 'toDate', 'toJSDate', '')[localeString]()
12591
+ ? __mld(dt, 'toDate', 'toJSDate', '')[localeString](
12592
+ navigator.language,
12593
+ { timeZone: "UTC" }
12594
+ )
12605
12595
  : __mld(dt, 'format', 'toFormat', 'toISOString', to);
12606
12596
 
12607
12597
  // XSS protection
@@ -13112,7 +13102,7 @@ var __numericReplace = function ( d, decimalPlace, re1, re2 ) {
13112
13102
 
13113
13103
  // If a decimal place other than `.` is used, it needs to be given to the
13114
13104
  // function so we can detect it and replace with a `.` which is the only
13115
- // decimal place Javascript recognises - it is not locale aware.
13105
+ // decimal place JavaScript recognises - it is not locale aware.
13116
13106
  if ( decimalPlace ) {
13117
13107
  d = _numToDecimal( d, decimalPlace );
13118
13108
  }
@@ -13170,7 +13160,7 @@ $.extend( true, DataTable.ext.renderer, {
13170
13160
  // on destroy, while the `dt` namespaced event is the one we are
13171
13161
  // listening for
13172
13162
  $(settings.nTable).on( 'order.dt.DT column-visibility.dt.DT', function ( e, ctx, column ) {
13173
- if ( settings !== ctx ) { // need to check this this is the host
13163
+ if ( settings !== ctx ) { // need to check if this is the host
13174
13164
  return; // table, not a nested one
13175
13165
  }
13176
13166