WP Google Maps - Version 5.05

Version Description

This is a must for users on IIS. Older WP Google Maps versions will not be compatible.

Download this release

Release Info

Developer WPGMaps
Plugin Icon 128x128 WP Google Maps
Version 5.05
Comparing to
See all releases

Code changes from version 5.04 to 5.05

js/jquery.dataTables.js CHANGED
@@ -1,7 +1,7 @@
1
/**
2
* @summary DataTables
3
* @description Paginate, search and sort HTML tables
4
- * @version 1.9.0
5
* @file jquery.dataTables.js
6
* @author Allan Jardine (www.sprymedia.co.uk)
7
* @contact www.sprymedia.co.uk/contact
@@ -21,9 +21,28 @@
21
*/
22
23
/*jslint evil: true, undef: true, browser: true */
24
- /*globals $, jQuery,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex*/
25
26
- (/** @lends <global> */function($, window, document, undefined) {
27
/**
28
* DataTables is a plug-in for the jQuery Javascript library. It is a
29
* highly flexible tool, based upon the foundations of progressive
@@ -76,7 +95,7 @@
76
"nTh": nTh ? nTh : document.createElement('th'),
77
"sTitle": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '',
78
"aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol],
79
- "mDataProp": oDefaults.mDataProp ? oDefaults.oDefaults : iCol
80
} );
81
oSettings.aoColumns.push( oCol );
82
@@ -115,7 +134,7 @@
115
* Apply options for a column
116
* @param {object} oSettings dataTables settings object
117
* @param {int} iCol column index to consider
118
- * @param {object} oOptions object with sType, bVisible and bSearchable
119
* @memberof DataTable#oApi
120
*/
121
function _fnColumnOptions( oSettings, iCol, oOptions )
@@ -125,6 +144,12 @@
125
/* User specified column options */
126
if ( oOptions !== undefined && oOptions !== null )
127
{
128
if ( oOptions.sType !== undefined )
129
{
130
oCol.sType = oOptions.sType;
@@ -145,8 +170,19 @@
145
}
146
147
/* Cache the data get and set functions for speed */
148
- oCol.fnGetData = _fnGetObjectDataFn( oCol.mDataProp );
149
- oCol.fnSetData = _fnSetObjectDataFn( oCol.mDataProp );
150
151
/* Feature sorting overrides column specific when off */
152
if ( !oSettings.oFeatures.bSort )
@@ -161,11 +197,10 @@
161
oCol.sSortingClass = oSettings.oClasses.sSortableNone;
162
oCol.sSortingClassJUI = "";
163
}
164
- else if ( oCol.bSortable ||
165
- ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) )
166
{
167
- oCol.sSortingClass = oSettings.oClasses.sSortable;
168
- oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI;
169
}
170
else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 )
171
{
@@ -188,7 +223,7 @@
188
*/
189
function _fnAdjustColumnSizing ( oSettings )
190
{
191
- /* Not interested in doing column width calculation if autowidth is disabled */
192
if ( oSettings.oFeatures.bAutoWidth === false )
193
{
194
return false;
@@ -212,22 +247,11 @@
212
*/
213
function _fnVisibleToColumnIndex( oSettings, iMatch )
214
{
215
- var iColumn = -1;
216
-
217
- for ( var i=0 ; i<oSettings.aoColumns.length ; i++ )
218
- {
219
- if ( oSettings.aoColumns[i].bVisible === true )
220
- {
221
- iColumn++;
222
- }
223
-
224
- if ( iColumn == iMatch )
225
- {
226
- return i;
227
- }
228
- }
229
-
230
- return null;
231
}
232
233
@@ -241,41 +265,44 @@
241
*/
242
function _fnColumnIndexToVisible( oSettings, iMatch )
243
{
244
- var iVisible = -1;
245
- for ( var i=0 ; i<oSettings.aoColumns.length ; i++ )
246
- {
247
- if ( oSettings.aoColumns[i].bVisible === true )
248
- {
249
- iVisible++;
250
- }
251
-
252
- if ( i == iMatch )
253
- {
254
- return oSettings.aoColumns[i].bVisible === true ? iVisible : null;
255
- }
256
- }
257
-
258
- return null;
259
}
260
261
262
/**
263
* Get the number of visible columns
264
* @returns {int} i the number of visible columns
265
- * @param {object} oS dataTables settings object
266
* @memberof DataTable#oApi
267
*/
268
- function _fnVisbleColumns( oS )
269
{
270
- var iVis = 0;
271
- for ( var i=0 ; i<oS.aoColumns.length ; i++ )
272
- {
273
- if ( oS.aoColumns[i].bVisible === true )
274
- {
275
- iVis++;
276
}
277
- }
278
- return iVis;
279
}
280
281
@@ -423,8 +450,6 @@
423
}
424
}
425
426
-
427
-
428
/**
429
* Add a data array to the table, creating DOM node etc. This is the parallel to
430
* _fnGatherData, but for adding rows from a Javascript source, rather than a
@@ -445,9 +470,8 @@
445
446
/* Create the object for storing information about this new row */
447
var iRow = oSettings.aoData.length;
448
- var oData = $.extend( true, {}, DataTable.models.oRow, {
449
- "_aData": aDataIn
450
- } );
451
oSettings.aoData.push( oData );
452
453
/* Create the cells */
@@ -456,11 +480,15 @@
456
{
457
oCol = oSettings.aoColumns[i];
458
459
- /* Use rendered data for filtering/sorting */
460
- if ( typeof oCol.fnRender === 'function' && oCol.bUseRendered && oCol.mDataProp !== null )
461
{
462
_fnSetCellData( oSettings, iRow, i, _fnRender(oSettings, iRow, i) );
463
}
464
465
/* See if we should auto-detect the column type */
466
if ( oCol._bAutoType && oCol.sType != 'string' )
@@ -486,7 +514,7 @@
486
/* Add to the display array */
487
oSettings.aiDisplayMaster.push( iRow );
488
489
- /* Create the DOM imformation */
490
if ( !oSettings.oFeatures.bDeferRender )
491
{
492
_fnCreateTr( oSettings, iRow );
@@ -504,7 +532,7 @@
504
function _fnGatherData( oSettings )
505
{
506
var iLoop, i, iLen, j, jLen, jInner,
507
- nTds, nTrs, nTd, aLocalData, iThisIndex,
508
iRow, iRows, iColumn, iColumns, sNodeName,
509
oCol, oData;
510
@@ -515,31 +543,32 @@
515
*/
516
if ( oSettings.bDeferLoading || oSettings.sAjaxSource === null )
517
{
518
- nTrs = oSettings.nTBody.childNodes;
519
- for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
520
{
521
- if ( nTrs[i].nodeName.toUpperCase() == "TR" )
522
{
523
iThisIndex = oSettings.aoData.length;
524
- nTrs[i]._DT_RowIndex = iThisIndex;
525
oSettings.aoData.push( $.extend( true, {}, DataTable.models.oRow, {
526
- "nTr": nTrs[i]
527
} ) );
528
-
529
oSettings.aiDisplayMaster.push( iThisIndex );
530
- nTds = nTrs[i].childNodes;
531
jInner = 0;
532
-
533
- for ( j=0, jLen=nTds.length ; j<jLen ; j++ )
534
{
535
- sNodeName = nTds[j].nodeName.toUpperCase();
536
if ( sNodeName == "TD" || sNodeName == "TH" )
537
{
538
- _fnSetCellData( oSettings, iThisIndex, jInner, $.trim(nTds[j].innerHTML) );
539
jInner++;
540
}
541
}
542
}
543
}
544
}
545
@@ -551,14 +580,15 @@
551
nTds = [];
552
for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
553
{
554
- for ( j=0, jLen=nTrs[i].childNodes.length ; j<jLen ; j++ )
555
{
556
- nTd = nTrs[i].childNodes[j];
557
sNodeName = nTd.nodeName.toUpperCase();
558
if ( sNodeName == "TD" || sNodeName == "TH" )
559
{
560
nTds.push( nTd );
561
}
562
}
563
}
564
@@ -608,8 +638,16 @@
608
}
609
}
610
611
- if ( typeof oCol.mDataProp === 'function' )
612
{
613
nCell.innerHTML = _fnGetCellData( oSettings, iRow, iColumn, 'display' );
614
}
615
@@ -620,7 +658,7 @@
620
nCell.innerHTML = sRendered;
621
if ( oCol.bUseRendered )
622
{
623
- /* Use the rendered data for filtering/sorting */
624
_fnSetCellData( oSettings, iRow, iColumn, sRendered );
625
}
626
}
@@ -631,7 +669,7 @@
631
nCell.className += ' '+oCol.sClass;
632
}
633
634
- /* Column visability */
635
if ( !bVisible )
636
{
637
oData._anHidden[iColumn] = nCell;
@@ -705,15 +743,16 @@
705
* @param {object} oSettings dataTables settings object
706
* @param {int} iRow aoData row id
707
* @param {string} sSpecific data get type ('type' 'filter' 'sort')
708
* @returns {array} Data array
709
* @memberof DataTable#oApi
710
*/
711
- function _fnGetRowData( oSettings, iRow, sSpecific )
712
{
713
var out = [];
714
- for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
715
{
716
- out.push( _fnGetCellData( oSettings, iRow, i, sSpecific ) );
717
}
718
return out;
719
}
@@ -738,8 +777,9 @@
738
{
739
if ( oSettings.iDrawError != oSettings.iDraw && oCol.sDefaultContent === null )
740
{
741
- _fnLog( oSettings, 0, "Requested unknown parameter '"+oCol.mDataProp+
742
- "' from the data source for row "+iRow );
743
oSettings.iDrawError = oSettings.iDraw;
744
}
745
return oCol.sDefaultContent;
@@ -781,6 +821,9 @@
781
}
782
783
784
/**
785
* Return a function that can be used to get data from a source object, taking
786
* into account the ability to use nested objects as a source
@@ -799,30 +842,71 @@
799
}
800
else if ( typeof mSource === 'function' )
801
{
802
- return function (data, type) {
803
- return mSource( data, type );
804
};
805
}
806
- else if ( typeof mSource === 'string' && mSource.indexOf('.') != -1 )
807
{
808
/* If there is a . in the source string then the data source is in a
809
* nested object so we loop over the data for each level to get the next
810
- * level down. On each loop we test for undefined, and if found immediatly
811
* return. This allows entire objects to be missing and sDefaultContent to
812
* be used if defined, rather than throwing an error
813
*/
814
- var a = mSource.split('.');
815
- return function (data, type) {
816
- for ( var i=0, iLen=a.length ; i<iLen ; i++ )
817
{
818
- data = data[ a[i] ];
819
- if ( data === undefined )
820
{
821
- return undefined;
822
}
823
}
824
return data;
825
};
826
}
827
else
828
{
@@ -854,16 +938,57 @@
854
mSource( data, 'set', val );
855
};
856
}
857
- else if ( typeof mSource === 'string' && mSource.indexOf('.') != -1 )
858
{
859
- /* Like the get, we need to get data from a nested object. */
860
- var a = mSource.split('.');
861
- return function (data, val) {
862
for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )
863
{
864
data = data[ a[i] ];
865
}
866
- data[ a[a.length-1] ] = val;
867
};
868
}
869
else
@@ -956,11 +1081,9 @@
956
"iDataColumn": iCol,
957
"oSettings": oSettings,
958
"aData": oSettings.aoData[iRow]._aData,
959
- "mDataProp": oCol.mDataProp
960
}, _fnGetCellData(oSettings, iRow, iCol, 'display') );
961
}
962
-
963
-
964
/**
965
* Create a new TR element (and it's TD children) for a row
966
* @param {object} oSettings dataTables settings object
@@ -989,19 +1112,19 @@
989
990
if ( oData._aData.DT_RowClass )
991
{
992
- $(oData.nTr).addClass( oData._aData.DT_RowClass );
993
}
994
995
/* Process each column */
996
for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
997
{
998
var oCol = oSettings.aoColumns[i];
999
- nTd = document.createElement('td');
1000
1001
/* Render if needed - if bUseRendered is true then we already have the rendered
1002
* value in the data source - so can just use that
1003
*/
1004
- nTd.innerHTML = (typeof oCol.fnRender === 'function' && (!oCol.bUseRendered || oCol.mDataProp === null)) ?
1005
_fnRender( oSettings, iRow, i ) :
1006
_fnGetCellData( oSettings, iRow, i, 'display' );
1007
@@ -1042,7 +1165,7 @@
1042
function _fnBuildHead( oSettings )
1043
{
1044
var i, nTh, iLen, j, jLen;
1045
- var iThs = oSettings.nTHead.getElementsByTagName('th').length;
1046
var iCorrector = 0;
1047
var jqChildren;
1048
@@ -1262,19 +1385,20 @@
1262
*/
1263
function _fnDraw( oSettings )
1264
{
1265
- var i, iLen, n;
1266
- var anRows = [];
1267
- var iRowCount = 0;
1268
- var iStripes = oSettings.asStripeClasses.length;
1269
- var iOpenRows = oSettings.aoOpenRows.length;
1270
-
1271
/* Provide a pre-callback function which can be used to cancel the draw is false is returned */
1272
var aPreDraw = _fnCallbackFire( oSettings, 'aoPreDrawCallback', 'preDraw', [oSettings] );
1273
if ( $.inArray( false, aPreDraw ) !== -1 )
1274
{
1275
return;
1276
}
1277
1278
oSettings.bDrawing = true;
1279
1280
/* Check and see if we have an initial draw position from state saving */
@@ -1340,7 +1464,7 @@
1340
}
1341
}
1342
1343
- /* Row callback functions - might want to manipule the row */
1344
_fnCallbackFire( oSettings, 'aoRowCallback', null,
1345
[nRow, oSettings.aoData[ oSettings.aiDisplay[j] ]._aData, iRowCount, j] );
1346
@@ -1371,22 +1495,22 @@
1371
anRows[ 0 ].className = oSettings.asStripeClasses[0];
1372
}
1373
1374
- var sZero = oSettings.oLanguage.sZeroRecords.replace(
1375
- '_MAX_', oSettings.fnFormatNumber(oSettings.fnRecordsTotal()) );
1376
if ( oSettings.iDraw == 1 && oSettings.sAjaxSource !== null && !oSettings.oFeatures.bServerSide )
1377
{
1378
- sZero = oSettings.oLanguage.sLoadingRecords;
1379
}
1380
- else if ( oSettings.oLanguage.sEmptyTable && oSettings.fnRecordsTotal() === 0 )
1381
{
1382
- sZero = oSettings.oLanguage.sEmptyTable;
1383
}
1384
1385
var nTd = document.createElement( 'td' );
1386
nTd.setAttribute( 'valign', "top" );
1387
nTd.colSpan = _fnVisbleColumns( oSettings );
1388
nTd.className = oSettings.oClasses.sRowEmpty;
1389
- nTd.innerHTML = sZero;
1390
1391
anRows[ iRowCount ].appendChild( nTd );
1392
}
@@ -1533,11 +1657,11 @@
1533
/* Replace jQuery UI constants */
1534
if ( sAttr == "H" )
1535
{
1536
- sAttr = "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix";
1537
}
1538
else if ( sAttr == "F" )
1539
{
1540
- sAttr = "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix";
1541
}
1542
1543
/* The attribute can be in the format of "#id.class", "#id" or "class" This logic
@@ -1652,10 +1776,12 @@
1652
function _fnDetectHeader ( aLayout, nThead )
1653
{
1654
var nTrs = $(nThead).children('tr');
1655
- var nCell;
1656
- var i, j, k, l, iLen, jLen, iColShifted;
1657
var fnShiftCol = function ( a, i, j ) {
1658
- while ( a[i][j] ) {
1659
j++;
1660
}
1661
return j;
@@ -1672,19 +1798,18 @@
1672
/* Calculate a layout array */
1673
for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
1674
{
1675
- var iColumn = 0;
1676
1677
/* For every cell in the row... */
1678
- for ( j=0, jLen=nTrs[i].childNodes.length ; j<jLen ; j++ )
1679
- {
1680
- nCell = nTrs[i].childNodes[j];
1681
-
1682
if ( nCell.nodeName.toUpperCase() == "TD" ||
1683
nCell.nodeName.toUpperCase() == "TH" )
1684
{
1685
/* Get the col and rowspan attributes from the DOM and sanitise them */
1686
- var iColspan = nCell.getAttribute('colspan') * 1;
1687
- var iRowspan = nCell.getAttribute('rowspan') * 1;
1688
iColspan = (!iColspan || iColspan===0 || iColspan===1) ? 1 : iColspan;
1689
iRowspan = (!iRowspan || iRowspan===0 || iRowspan===1) ? 1 : iRowspan;
1690
@@ -1693,6 +1818,9 @@
1693
*/
1694
iColShifted = fnShiftCol( aLayout, i, iColumn );
1695
1696
/* If there is col / rowspan, copy the information into the layout grid */
1697
for ( l=0 ; l<iColspan ; l++ )
1698
{
@@ -1700,12 +1828,13 @@
1700
{
1701
aLayout[i+k][iColShifted+l] = {
1702
"cell": nCell,
1703
- "unique": iColspan == 1 ? true : false
1704
};
1705
- aLayout[i+k].nTr = nTrs[i];
1706
}
1707
}
1708
}
1709
}
1710
}
1711
}
@@ -1716,7 +1845,7 @@
1716
* @param {object} oSettings dataTables settings object
1717
* @param {node} nHeader automatically detect the layout from this node - optional
1718
* @param {array} aLayout thead/tfoot layout from _fnDetectHeader - optional
1719
- * @returns array {node} aReturn list of unique ths
1720
* @memberof DataTable#oApi
1721
*/
1722
function _fnGetUniqueThs ( oSettings, nHeader, aLayout )
@@ -1787,8 +1916,8 @@
1787
function _fnAjaxParameters( oSettings )
1788
{
1789
var iColumns = oSettings.aoColumns.length;
1790
- var aoData = [], mDataProp;
1791
- var i;
1792
1793
aoData.push( { "name": "sEcho", "value": oSettings.iDraw } );
1794
aoData.push( { "name": "iColumns", "value": iColumns } );
@@ -1799,7 +1928,7 @@
1799
1800
for ( i=0 ; i<iColumns ; i++ )
1801
{
1802
- mDataProp = oSettings.aoColumns[i].mDataProp;
1803
aoData.push( { "name": "mDataProp_"+i, "value": typeof(mDataProp)==="function" ? 'function' : mDataProp } );
1804
}
1805
@@ -1819,20 +1948,24 @@
1819
/* Sorting */
1820
if ( oSettings.oFeatures.bSort !== false )
1821
{
1822
- var iFixed = oSettings.aaSortingFixed !== null ? oSettings.aaSortingFixed.length : 0;
1823
- var iUser = oSettings.aaSorting.length;
1824
- aoData.push( { "name": "iSortingCols", "value": iFixed+iUser } );
1825
- for ( i=0 ; i<iFixed ; i++ )
1826
- {
1827
- aoData.push( { "name": "iSortCol_"+i, "value": oSettings.aaSortingFixed[i][0] } );
1828
- aoData.push( { "name": "sSortDir_"+i, "value": oSettings.aaSortingFixed[i][1] } );
1829
- }
1830
1831
- for ( i=0 ; i<iUser ; i++ )
1832
{
1833
- aoData.push( { "name": "iSortCol_"+(i+iFixed), "value": oSettings.aaSorting[i][0] } );
1834
- aoData.push( { "name": "sSortDir_"+(i+iFixed), "value": oSettings.aaSorting[i][1] } );
1835
}
1836
1837
for ( i=0 ; i<iColumns ; i++ )
1838
{
@@ -1845,7 +1978,7 @@
1845
1846
1847
/**
1848
- * Add Ajax parameters from plugins
1849
* @param {object} oSettings dataTables settings object
1850
* @param array {objects} aoData name/value pairs to send to the server
1851
* @memberof DataTable#oApi
@@ -1872,7 +2005,7 @@
1872
if ( json.sEcho !== undefined )
1873
{
1874
/* Protect against old returns over-writing a new one. Possible when you get
1875
- * very fast interaction, and later queires are completed much faster
1876
*/
1877
if ( json.sEcho*1 < oSettings.iDraw )
1878
{
@@ -1953,24 +2086,31 @@
1953
nFilter.id = oSettings.sTableId+'_filter';
1954
}
1955
1956
- var jqFilter = $("input", nFilter);
1957
jqFilter.val( oPreviousSearch.sSearch.replace('"','&quot;') );
1958
jqFilter.bind( 'keyup.DT', function(e) {
1959
/* Update all other filter input elements for the new display */
1960
var n = oSettings.aanFeatures.f;
1961
for ( var i=0, iLen=n.length ; i<iLen ; i++ )
1962
{
1963
if ( n[i] != $(this).parents('div.dataTables_filter')[0] )
1964
{
1965
- $('input', n[i]).val( this.value );
1966
}
1967
}
1968
1969
/* Now do the filter */
1970
- if ( this.value != oPreviousSearch.sSearch )
1971
{
1972
_fnFilterComplete( oSettings, {
1973
- "sSearch": this.value,
1974
"bRegex": oPreviousSearch.bRegex,
1975
"bSmart": oPreviousSearch.bSmart ,
1976
"bCaseInsensitive": oPreviousSearch.bCaseInsensitive
@@ -2056,15 +2196,22 @@
2056
function _fnFilterCustom( oSettings )
2057
{
2058
var afnFilters = DataTable.ext.afnFiltering;
2059
for ( var i=0, iLen=afnFilters.length ; i<iLen ; i++ )
2060
{
2061
var iCorrector = 0;
2062
for ( var j=0, jLen=oSettings.aiDisplay.length ; j<jLen ; j++ )
2063
{
2064
var iDisIndex = oSettings.aiDisplay[j-iCorrector];
2065
2066
/* Check if we should use this row based on the filtering function */
2067
- if ( !afnFilters[i]( oSettings, _fnGetRowData( oSettings, iDisIndex, 'filter' ), iDisIndex ) )
2068
{
2069
oSettings.aiDisplay.splice( j-iCorrector, 1 );
2070
iCorrector++;
@@ -2203,15 +2350,19 @@
2203
if ( !oSettings.oFeatures.bServerSide )
2204
{
2205
/* Clear out the old data */
2206
- oSettings.asDataSearch.splice( 0, oSettings.asDataSearch.length );
2207
-
2208
- var aArray = (iMaster && iMaster===1) ?
2209
- oSettings.aiDisplayMaster : oSettings.aiDisplay;
2210
2211
- for ( var i=0, iLen=aArray.length ; i<iLen ; i++ )
2212
{
2213
- oSettings.asDataSearch[i] = _fnBuildSearchRow( oSettings,
2214
- _fnGetRowData( oSettings, aArray[i], 'filter' ) );
2215
}
2216
}
2217
}
@@ -2225,33 +2376,16 @@
2225
*/
2226
function _fnBuildSearchRow( oSettings, aData )
2227
{
2228
- var sSearch = '';
2229
- if ( oSettings.__nTmpFilter === undefined )
2230
- {
2231
- oSettings.__nTmpFilter = document.createElement('div');
2232
- }
2233
- var nTmp = oSettings.__nTmpFilter;
2234
-
2235
- for ( var j=0, jLen=oSettings.aoColumns.length ; j<jLen ; j++ )
2236
- {
2237
- if ( oSettings.aoColumns[j].bSearchable )
2238
- {
2239
- var sData = aData[j];
2240
- sSearch += _fnDataToSearch( sData, oSettings.aoColumns[j].sType )+' ';
2241
- }
2242
- }
2243
2244
/* If it looks like there is an HTML entity in the string, attempt to decode it */
2245
if ( sSearch.indexOf('&') !== -1 )
2246
{
2247
- nTmp.innerHTML = sSearch;
2248
- sSearch = nTmp.textContent ? nTmp.textContent : nTmp.innerText;
2249
-
2250
- /* IE and Opera appear to put an newline where there is a <br> tag - remove it */
2251
- sSearch = sSearch.replace(/\n/g," ").replace(/\r/g,"");
2252
}
2253
2254
- return sSearch;
2255
}
2256
2257
/**
@@ -2259,7 +2393,7 @@
2259
* @param {string} sSearch string to search for
2260
* @param {bool} bRegex treat as a regular expression or not
2261
* @param {bool} bSmart perform smart filtering or not
2262
- * @param {bool} bCaseInsensitive Do case insenstive matching or not
2263
* @returns {RegExp} constructed object
2264
* @memberof DataTable#oApi
2265
*/
@@ -2297,6 +2431,10 @@
2297
{
2298
return DataTable.ext.ofnSearch[sType]( sData );
2299
}
2300
else if ( sType == "html" )
2301
{
2302
return sData.replace(/[\r\n]/g," ").replace( /<.*?>/g, "" );
@@ -2305,29 +2443,24 @@
2305
{
2306
return sData.replace(/[\r\n]/g," ");
2307
}
2308
- else if ( sData === null )
2309
- {
2310
- return '';
2311
- }
2312
return sData;
2313
}
2314
2315
2316
/**
2317
- * scape a string stuch that it can be used in a regular expression
2318
* @param {string} sVal string to escape
2319
* @returns {string} escaped string
2320
* @memberof DataTable#oApi
2321
*/
2322
function _fnEscapeRegex ( sVal )
2323
{
2324
- var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '#x27;, '^' ];
2325
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
2326
return sVal.replace(reReplace, '\\$1');
2327
}
2328
2329
2330
-
2331
/**
2332
* Generate the node required for the info display
2333
* @param {object} oSettings dataTables settings object
@@ -2371,57 +2504,36 @@
2371
}
2372
2373
var
2374
- iStart = oSettings._iDisplayStart+1, iEnd = oSettings.fnDisplayEnd(),
2375
- iMax = oSettings.fnRecordsTotal(), iTotal = oSettings.fnRecordsDisplay(),
2376
- sStart = oSettings.fnFormatNumber( iStart ), sEnd = oSettings.fnFormatNumber( iEnd ),
2377
- sMax = oSettings.fnFormatNumber( iMax ), sTotal = oSettings.fnFormatNumber( iTotal ),
2378
sOut;
2379
2380
- /* When infinite scrolling, we are always starting at 1. _iDisplayStart is used only
2381
- * internally
2382
- */
2383
- if ( oSettings.oScroll.bInfinite )
2384
- {
2385
- sStart = oSettings.fnFormatNumber( 1 );
2386
- }
2387
-
2388
- if ( oSettings.fnRecordsDisplay() === 0 &&
2389
- oSettings.fnRecordsDisplay() == oSettings.fnRecordsTotal() )
2390
{
2391
/* Empty record set */
2392
- sOut = oSettings.oLanguage.sInfoEmpty+ oSettings.oLanguage.sInfoPostFix;
2393
}
2394
- else if ( oSettings.fnRecordsDisplay() === 0 )
2395
- {
2396
- /* Rmpty record set after filtering */
2397
- sOut = oSettings.oLanguage.sInfoEmpty +' '+
2398
- oSettings.oLanguage.sInfoFiltered.replace('_MAX_', sMax)+
2399
- oSettings.oLanguage.sInfoPostFix;
2400
- }
2401
- else if ( oSettings.fnRecordsDisplay() == oSettings.fnRecordsTotal() )
2402
- {
2403
/* Normal record set */
2404
- sOut = oSettings.oLanguage.sInfo.
2405
- replace('_START_', sStart).
2406
- replace('_END_', sEnd).
2407
- replace('_TOTAL_', sTotal)+
2408
- oSettings.oLanguage.sInfoPostFix;
2409
}
2410
- else
2411
{
2412
/* Record set after filtering */
2413
- sOut = oSettings.oLanguage.sInfo.
2414
- replace('_START_', sStart).
2415
- replace('_END_', sEnd).
2416
- replace('_TOTAL_', sTotal) +' '+
2417
- oSettings.oLanguage.sInfoFiltered.replace('_MAX_',
2418
- oSettings.fnFormatNumber(oSettings.fnRecordsTotal()))+
2419
- oSettings.oLanguage.sInfoPostFix;
2420
}
2421
2422
- if ( oSettings.oLanguage.fnInfoCallback !== null )
2423
{
2424
- sOut = oSettings.oLanguage.fnInfoCallback.call( oSettings.oInstance,
2425
oSettings, iStart, iEnd, iMax, iTotal, sOut );
2426
}
2427
@@ -2433,6 +2545,33 @@
2433
}
2434
2435
2436
2437
/**
2438
* Draw the table for the first time, adding all required features
@@ -2566,16 +2705,20 @@
2566
*/
2567
function _fnLanguageCompat( oLanguage )
2568
{
2569
/* Backwards compatibility - if there is no sEmptyTable given, then use the same as
2570
* sZeroRecords - assuming that is given.
2571
*/
2572
- if ( !oLanguage.sEmptyTable && oLanguage.sZeroRecords )
2573
{
2574
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sEmptyTable' );
2575
}
2576
2577
/* Likewise with loading records */
2578
- if ( !oLanguage.sLoadingRecords && oLanguage.sZeroRecords )
2579
{
2580
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sLoadingRecords' );
2581
}
@@ -2676,7 +2819,7 @@
2676
2677
2678
/**
2679
- * Rcalculate the end point based on the start point
2680
* @param {object} oSettings dataTables settings object
2681
* @memberof DataTable#oApi
2682
*/
@@ -2780,7 +2923,7 @@
2780
oSettings._iDisplayStart - oSettings._iDisplayLength :
2781
0;
2782
2783
- /* Correct for underrun */
2784
if ( oSettings._iDisplayStart < 0 )
2785
{
2786
oSettings._iDisplayStart = 0;
@@ -2866,8 +3009,6 @@
2866
$(oSettings.oInstance).trigger('processing', [oSettings, bShow]);
2867
}
2868
2869
-
2870
-
2871
/**
2872
* Add any control elements for the table - specifically scrolling
2873
* @param {object} oSettings dataTables settings object
@@ -2944,7 +3085,8 @@
2944
nScrollHead.style.border = "0";
2945
nScrollHead.style.width = "100%";
2946
nScrollFoot.style.border = "0";
2947
- nScrollHeadInner.style.width = "150%"; /* will be overwritten */
2948
2949
/* Modify attributes to respect the clones */
2950
nScrollHeadTable.removeAttribute('id');
@@ -2956,17 +3098,26 @@
2956
nScrollFootTable.style.marginLeft = "0";
2957
}
2958
2959
- /* Move any caption elements from the body to the header */
2960
- var nCaptions = $(oSettings.nTable).children('caption');
2961
- for ( var i=0, iLen=nCaptions.length ; i<iLen ; i++ )
2962
{
2963
- nScrollHeadTable.appendChild( nCaptions[i] );
2964
}
2965
2966
/*
2967
* Sizing
2968
*/
2969
- /* When xscrolling add the width and a scroller to move the header with the body */
2970
if ( oSettings.oScroll.sX !== "" )
2971
{
2972
nScrollHead.style.width = _fnStringToCss( oSettings.oScroll.sX );
@@ -3048,41 +3199,39 @@
3048
nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
3049
nScrollBody = o.nTable.parentNode,
3050
i, iLen, j, jLen, anHeadToSize, anHeadSizers, anFootSizers, anFootToSize, oStyle, iVis,
3051
- iWidth, aApplied=[], iSanityWidth,
3052
nScrollFootInner = (o.nTFoot !== null) ? o.nScrollFoot.getElementsByTagName('div')[0] : null,
3053
nScrollFootTable = (o.nTFoot !== null) ? nScrollFootInner.getElementsByTagName('table')[0] : null,
3054
- ie67 = $.browser.msie && $.browser.version <= 7;
3055
3056
/*
3057
* 1. Re-create the table inside the scrolling div
3058
*/
3059
3060
/* Remove the old minimised thead and tfoot elements in the inner table */
3061
- var nTheadSize = o.nTable.getElementsByTagName('thead');
3062
- if ( nTheadSize.length > 0 )
3063
- {
3064
- o.nTable.removeChild( nTheadSize[0] );
3065
- }
3066
-
3067
- var nTfootSize;
3068
- if ( o.nTFoot !== null )
3069
- {
3070
- /* Remove the old minimised footer element in the cloned header */
3071
- nTfootSize = o.nTable.getElementsByTagName('tfoot');
3072
- if ( nTfootSize.length > 0 )
3073
- {
3074
- o.nTable.removeChild( nTfootSize[0] );
3075
- }
3076
- }
3077
-
3078
/* Clone the current header and footer elements and then place it into the inner table */
3079
- nTheadSize = o.nTHead.cloneNode(true);
3080
o.nTable.insertBefore( nTheadSize, o.nTable.childNodes[0] );
3081
3082
if ( o.nTFoot !== null )
3083
{
3084
- nTfootSize = o.nTFoot.cloneNode(true);
3085
o.nTable.insertBefore( nTfootSize, o.nTable.childNodes[1] );
3086
}
3087
3088
/*
@@ -3091,7 +3240,7 @@
3091
3092
/* Remove old sizing and apply the calculated column widths
3093
* Get the unique column headers in the newly created (cloned) header. We want to apply the
3094
- * calclated sizes to this header
3095
*/
3096
if ( o.oScroll.sX === "" )
3097
{
@@ -3110,7 +3259,15 @@
3110
{
3111
_fnApplyToChildren( function(n) {
3112
n.style.width = "";
3113
- }, nTfootSize.getElementsByTagName('tr') );
3114
}
3115
3116
/* Size the table as a whole */
@@ -3127,7 +3284,7 @@
3127
if ( ie67 && ($('tbody', nScrollBody).height() > nScrollBody.offsetHeight ||
3128
$(nScrollBody).css('overflow-y') == "scroll") )
3129
{
3130
- o.nTable.style.width = _fnStringToCss( $(o.nTable).outerWidth()-o.oScroll.iBarWidth );
3131
}
3132
}
3133
else
@@ -3164,41 +3321,38 @@
3164
/* We want the hidden header to have zero height, so remove padding and borders. Then
3165
* set the width based on the real headers
3166
*/
3167
- anHeadToSize = o.nTHead.getElementsByTagName('tr');
3168
- anHeadSizers = nTheadSize.getElementsByTagName('tr');
3169
3170
- _fnApplyToChildren( function(nSizer, nToSize) {
3171
- oStyle = nSizer.style;
3172
- oStyle.paddingTop = "0";
3173
- oStyle.paddingBottom = "0";
3174
- oStyle.borderTopWidth = "0";
3175
- oStyle.borderBottomWidth = "0";
3176
- oStyle.height = 0;
3177
-
3178
- iWidth = $(nSizer).width();
3179
- nToSize.style.width = _fnStringToCss( iWidth );
3180
- aApplied.push( iWidth );
3181
- }, anHeadSizers, anHeadToSize );
3182
$(anHeadSizers).height(0);
3183
3184
if ( o.nTFoot !== null )
3185
{
3186
- /* Clone the current footer and then place it into the body table as a "hidden header" */
3187
- anFootSizers = nTfootSize.getElementsByTagName('tr');
3188
- anFootToSize = o.nTFoot.getElementsByTagName('tr');
3189
-
3190
- _fnApplyToChildren( function(nSizer, nToSize) {
3191
- oStyle = nSizer.style;
3192
- oStyle.paddingTop = "0";
3193
- oStyle.paddingBottom = "0";
3194
- oStyle.borderTopWidth = "0";
3195
- oStyle.borderBottomWidth = "0";
3196
- oStyle.height = 0;
3197
-
3198
- iWidth = $(nSizer).width();
3199
- nToSize.style.width = _fnStringToCss( iWidth );
3200
- aApplied.push( iWidth );
3201
- }, anFootSizers, anFootToSize );
3202
$(anFootSizers).height(0);
3203
}
3204
@@ -3209,16 +3363,16 @@
3209
/* "Hide" the header and footer that we used for the sizing. We want to also fix their width
3210
* to what they currently are
3211
*/
3212
- _fnApplyToChildren( function(nSizer) {
3213
nSizer.innerHTML = "";
3214
- nSizer.style.width = _fnStringToCss( aApplied.shift() );
3215
}, anHeadSizers );
3216
3217
if ( o.nTFoot !== null )
3218
{
3219
- _fnApplyToChildren( function(nSizer) {
3220
nSizer.innerHTML = "";
3221
- nSizer.style.width = _fnStringToCss( aApplied.shift() );
3222
}, anFootSizers );
3223
}
3224
@@ -3241,11 +3395,11 @@
3241
3242
/* Apply the calculated minimum width to the table wrappers */
3243
nScrollBody.style.width = _fnStringToCss( iCorrection );
3244
- nScrollHeadInner.parentNode.style.width = _fnStringToCss( iCorrection );
3245
3246
if ( o.nTFoot !== null )
3247
{
3248
- nScrollFootInner.parentNode.style.width = _fnStringToCss( iCorrection );
3249
}
3250
3251
/* And give the user a warning that we've stopped the table getting too small */
@@ -3264,11 +3418,11 @@
3264
else
3265
{
3266
nScrollBody.style.width = _fnStringToCss( '100%' );
3267
- nScrollHeadInner.parentNode.style.width = _fnStringToCss( '100%' );
3268
3269
if ( o.nTFoot !== null )
3270
{
3271
- nScrollFootInner.parentNode.style.width = _fnStringToCss( '100%' );
3272
}
3273
}
3274
@@ -3296,7 +3450,7 @@
3296
o.oScroll.iBarWidth : 0;
3297
if ( o.nTable.offsetHeight < nScrollBody.offsetHeight )
3298
{
3299
- nScrollBody.style.height = _fnStringToCss( $(o.nTable).height()+iExtra );
3300
}
3301
}
3302
@@ -3304,12 +3458,21 @@
3304
var iOuterWidth = $(o.nTable).outerWidth();
3305
nScrollHeadTable.style.width = _fnStringToCss( iOuterWidth );
3306
nScrollHeadInner.style.width = _fnStringToCss( iOuterWidth );
3307
3308
if ( o.nTFoot !== null )
3309
{
3310
- nScrollFootInner.style.width = _fnStringToCss( o.nTable.offsetWidth );
3311
- nScrollFootTable.style.width = _fnStringToCss( o.nTable.offsetWidth );
3312
}
3313
3314
/* If sorting or filtering has occurred, jump the scrolling back to the top */
3315
if ( o.bSorted || o.bFiltered )
@@ -3329,27 +3492,34 @@
3329
*/
3330
function _fnApplyToChildren( fn, an1, an2 )
3331
{
3332
- for ( var i=0, iLen=an1.length ; i<iLen ; i++ )
3333
{
3334
- for ( var j=0, jLen=an1[i].childNodes.length ; j<jLen ; j++ )
3335
{
3336
- if ( an1[i].childNodes[j].nodeType == 1 )
3337
{
3338
if ( an2 )
3339
{
3340
- fn( an1[i].childNodes[j], an2[i].childNodes[j] );
3341
}
3342
else
3343
{
3344
- fn( an1[i].childNodes[j] );
3345
}
3346
}
3347
}
3348
}
3349
}
3350
3351
-
3352
-
3353
/**
3354
* Convert a CSS unit width to pixels (e.g. 2em)
3355
* @param {string} sWidth width to be converted
@@ -3366,7 +3536,7 @@
3366
3367
if ( !nParent )
3368
{
3369
- nParent = document.getElementsByTagName('body')[0];
3370
}
3371
3372
var iWidth;
@@ -3396,6 +3566,7 @@
3396
var i, iIndex, iCorrector, iWidth;
3397
var oHeaders = $('th', oSettings.nTHead);
3398
var widthAttr = oSettings.nTable.getAttribute('width');
3399
3400
/* Convert any user input sizes into pixel sizes */
3401
for ( i=0 ; i<iColums ; i++ )
@@ -3407,7 +3578,7 @@
3407
if ( oSettings.aoColumns[i].sWidth !== null )
3408
{
3409
iTmpWidth = _fnConvertToWidth( oSettings.aoColumns[i].sWidthOrig,
3410
- oSettings.nTable.parentNode );
3411
if ( iTmpWidth !== null )
3412
{
3413
oSettings.aoColumns[i].sWidth = _fnStringToCss( iTmpWidth );
@@ -3507,7 +3678,6 @@
3507
}
3508
3509
/* Build the table and 'display' it */
3510
- var nWrapper = oSettings.nTable.parentNode;
3511
nWrapper.appendChild( nCalcTmp );
3512
3513
/* When scrolling (X or Y) we want to set the width of the table as appropriate. However,
@@ -3634,7 +3804,7 @@
3634
* Get the widest node
3635
* @param {object} oSettings dataTables settings object
3636
* @param {int} iCol column of interest
3637
- * @returns {string} max strlens for each column
3638
* @memberof DataTable#oApi
3639
*/
3640
function _fnGetWidestNode( oSettings, iCol )
@@ -3659,7 +3829,7 @@
3659
* Get the maximum strlen for each data column
3660
* @param {object} oSettings dataTables settings object
3661
* @param {int} iCol column of interest
3662
- * @returns {string} max strlens for each column
3663
* @memberof DataTable#oApi
3664
*/
3665
function _fnGetMaxLenString( oSettings, iCol )
@@ -3753,8 +3923,6 @@
3753
return (w1 - w2);
3754
}
3755
3756
-
3757
-
3758
/**
3759
* Change the order of the table
3760
* @param {object} oSettings dataTables settings object
@@ -3777,16 +3945,11 @@
3777
if ( !oSettings.oFeatures.bServerSide &&
3778
(oSettings.aaSorting.length !== 0 || oSettings.aaSortingFixed !== null) )
3779
{
3780
- if ( oSettings.aaSortingFixed !== null )
3781
- {
3782
- aaSort = oSettings.aaSortingFixed.concat( oSettings.aaSorting );
3783
- }
3784
- else
3785
- {
3786
- aaSort = oSettings.aaSorting.slice();
3787
- }
3788
3789
- /* If there is a sorting data type, and a fuction belonging to it, then we need to
3790
* get the data from the developer's function and apply it for this column
3791
*/
3792
for ( i=0 ; i<aaSort.length ; i++ )
@@ -3796,10 +3959,19 @@
3796
sDataType = oSettings.aoColumns[ iColumn ].sSortDataType;
3797
if ( DataTable.ext.afnSortData[sDataType] )
3798
{
3799
- var aData = DataTable.ext.afnSortData[sDataType]( oSettings, iColumn, iVisColumn );
3800
- for ( j=0, jLen=aoData.length ; j<jLen ; j++ )
3801
{
3802
- _fnSetCellData( oSettings, j, iColumn, aData[j] );
3803
}
3804
}
3805
}
@@ -3887,6 +4059,7 @@
3887
3888
for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
3889
{
3890
nTh = aoColumns[i].nTh;
3891
nTh.removeAttribute('aria-sort');
3892
nTh.removeAttribute('aria-label');
@@ -3900,18 +4073,18 @@
3900
3901
var nextSort = (aoColumns[i].asSorting[ aaSort[0][2]+1 ]) ?
3902
aoColumns[i].asSorting[ aaSort[0][2]+1 ] : aoColumns[i].asSorting[0];
3903
- nTh.setAttribute('aria-label', aoColumns[i].sTitle+
3904
(nextSort=="asc" ? oAria.sSortAscending : oAria.sSortDescending) );
3905
}
3906
else
3907
{
3908
- nTh.setAttribute('aria-label', aoColumns[i].sTitle+
3909
(aoColumns[i].asSorting[0]=="asc" ? oAria.sSortAscending : oAria.sSortDescending) );
3910
}
3911
}
3912
else
3913
{
3914
- nTh.setAttribute('aria-label', aoColumns[i].sTitle);
3915
}
3916
}
3917
@@ -3958,17 +4131,17 @@
3958
* twice - once for when bProcessing is enabled, and another time for when it is
3959
* disabled, as we need to perform slightly different actions.
3960
* Basically the issue here is that the Javascript engine in modern browsers don't
3961
- * appear to allow the rendering engine to update the display while it is still excuting
3962
* it's thread (well - it does but only after long intervals). This means that the
3963
* 'processing' display doesn't appear for a table sort. To break the js thread up a bit
3964
* I force an execution break by using setTimeout - but this breaks the expected
3965
* thread continuation for the end-developer's point of view (their code would execute
3966
- * too early), so we on;y do it when we absolutely have to.
3967
*/
3968
var fnInnerSorting = function () {
3969
var iColumn, iNextSort;
3970
3971
- /* If the shift key is pressed then we are multipe column sorting */
3972
if ( e.shiftKey )
3973
{
3974
/* Are we already doing some kind of sort on this column? */
@@ -4141,10 +4314,10 @@
4141
* Apply the required classes to the table body
4142
* Note that this is given as a feature switch since it can significantly slow down a sort
4143
* on large data sets (adding and removing of classes is always slow at the best of times..)
4144
- * Further to this, note that this code is admitadly fairly ugly. It could be made a lot
4145
- * simpiler using jQuery selectors and add/removeClass, but that is significantly slower
4146
* (on the order of 5 times slower) - hence the direct DOM manipulation here.
4147
- * Note that for defered drawing we do use jQuery - the reason being that taking the first
4148
* row found to see if the whole column needs processed can miss classes since the first
4149
* column might be new.
4150
*/
@@ -4153,56 +4326,49 @@
4153
if ( oSettings.oFeatures.bSort && oSettings.oFeatures.bSortClasses )
4154
{
4155
var nTds = _fnGetTdNodes( oSettings );
4156
-
4157
- /* Remove the old classes */
4158
- if ( oSettings.oFeatures.bDeferRender )
4159
{
4160
- $(nTds).removeClass(sClass+'1 '+sClass+'2 '+sClass+'3');
4161
}
4162
- else if ( nTds.length >= iColumns )
4163
{
4164
- for ( i=0 ; i<iColumns ; i++ )
4165
{
4166
- if ( nTds[i].className.indexOf(sClass+"1") != -1 )
4167
- {
4168
- for ( j=0, jLen=(nTds.length/iColumns) ; j<jLen ; j++ )
4169
- {
4170
- nTds[(iColumns*j)+i].className =
4171
- $.trim( nTds[(iColumns*j)+i].className.replace( sClass+"1", "" ) );
4172
- }
4173
- }
4174
- else if ( nTds[i].className.indexOf(sClass+"2") != -1 )
4175
- {
4176
- for ( j=0, jLen=(nTds.length/iColumns) ; j<jLen ; j++ )
4177
- {
4178
- nTds[(iColumns*j)+i].className =
4179
- $.trim( nTds[(iColumns*j)+i].className.replace( sClass+"2", "" ) );
4180
- }
4181
- }
4182
- else if ( nTds[i].className.indexOf(sClass+"3") != -1 )
4183
- {
4184
- for ( j=0, jLen=(nTds.length/iColumns) ; j<jLen ; j++ )
4185
- {
4186
- nTds[(iColumns*j)+i].className =
4187
- $.trim( nTds[(iColumns*j)+i].className.replace( " "+sClass+"3", "" ) );
4188
- }
4189
- }
4190
}
4191
}
4192
4193
- /* Add the new classes to the table */
4194
- var iClass = 1, iTargetCol;
4195
- for ( i=0 ; i<aaSort.length ; i++ )
4196
{
4197
- iTargetCol = parseInt( aaSort[i][0], 10 );
4198
- for ( j=0, jLen=(nTds.length/iColumns) ; j<jLen ; j++ )
4199
{
4200
- nTds[(iColumns*j)+iTargetCol].className += " "+sClass+iClass;
4201
}
4202
-
4203
- if ( iClass < 3 )
4204
{
4205
- iClass++;
4206
}
4207
}
4208
}
@@ -4290,7 +4456,7 @@
4290
$.extend( true, oSettings.aoPreSearchCols, oData.aoSearchCols );
4291
4292
/* Column visibility state
4293
- * Pass back visibiliy settings to the init handler, but to do not here override
4294
* the init object that the user might have passed in
4295
*/
4296
oInit.saved_aoColumns = [];
@@ -4342,35 +4508,50 @@
4342
}
4343
4344
/* Are we going to go over the cookie limit of 4KiB? If so, try to delete a cookies
4345
- * belonging to DataTables. This is FAR from bullet proof
4346
*/
4347
- var sOldName="", iOldTime=9999999999999;
4348
- var iLength = _fnReadCookie( sNameFile )!==null ? document.cookie.length :
4349
- sFullCookie.length + document.cookie.length;
4350
4351
- if ( iLength+10 > 4096 ) /* Magic 10 for padding */
4352
{
4353
- var aCookies =document.cookie.split(';');
4354
for ( var i=0, iLen=aCookies.length ; i<iLen ; i++ )
4355
{
4356
if ( aCookies[i].indexOf( sBaseName ) != -1 )
4357
{
4358
/* It's a DataTables cookie, so eval it and check the time stamp */
4359
var aSplitCookie = aCookies[i].split('=');
4360
- try { oData = eval( '('+decodeURIComponent(aSplitCookie[1])+')' ); }
4361
- catch( e ) { continue; }
4362
-
4363
- if ( oData.iCreate && oData.iCreate < iOldTime )
4364
- {
4365
- sOldName = aSplitCookie[0];
4366
- iOldTime = oData.iCreate;
4367
}
4368
}
4369
}
4370
-
4371
- if ( sOldName !== "" )
4372
- {
4373
- document.cookie = sOldName+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+
4374
aParts.join('/') + "/";
4375
}
4376
}
@@ -4410,7 +4591,6 @@
4410
}
4411
4412
4413
-
4414
/**
4415
* Return the settings object for a particular table
4416
* @param {node} nTable table we are using as a dataTable
@@ -4464,7 +4644,7 @@
4464
{
4465
var anReturn = [];
4466
var iCorrector;
4467
- var anTds;
4468
var iRow, iRows=oSettings.aoData.length,
4469
iColumn, iColumns, oData, sNodeName, iStart=0, iEnd=iRows;
4470
@@ -4482,13 +4662,15 @@
4482
{
4483
/* get the TD child nodes - taking into account text etc nodes */
4484
anTds = [];
4485
- for ( iColumn=0, iColumns=oData.nTr.childNodes.length ; iColumn<iColumns ; iColumn++ )
4486
{
4487
- sNodeName = oData.nTr.childNodes[iColumn].nodeName.toLowerCase();
4488
if ( sNodeName == 'td' || sNodeName == 'th' )
4489
{
4490
- anTds.push( oData.nTr.childNodes[iColumn] );
4491
}
4492
}
4493
4494
iCorrector = 0;
@@ -4532,11 +4714,11 @@
4532
}
4533
else
4534
{
4535
- throw sAlert;
4536
}
4537
return;
4538
}
4539
- else if ( console !== undefined && console.log )
4540
{
4541
console.log( sAlert );
4542
}
@@ -4577,17 +4759,21 @@
4577
*/
4578
function _fnExtend( oOut, oExtender )
4579
{
4580
- for ( var prop in oOut )
4581
{
4582
- if ( oOut.hasOwnProperty(prop) && oExtender[prop] !== undefined )
4583
{
4584
- if ( typeof oInit[prop] === 'object' && $.isArray(oExtender[prop]) === false )
4585
{
4586
- $.extend( true, oOut[prop], oExtender[prop] );
4587
}
4588
else
4589
{
4590
- oOut[prop] = oExtender[prop];
4591
}
4592
}
4593
}
@@ -4598,19 +4784,19 @@
4598
4599
/**
4600
* Bind an event handers to allow a click or return key to activate the callback.
4601
- * This is good for accessability since a return on the keyboard will have the
4602
* same effect as a click, if the element has focus.
4603
* @param {element} n Element to bind the action to
4604
* @param {object} oData Data object to pass to the triggered function
4605
- * @param {function) fn Callback function for when the event is triggered
4606
* @memberof DataTable#oApi
4607
*/
4608
function _fnBindAction( n, oData, fn )
4609
{
4610
$(n)
4611
.bind( 'click.DT', oData, function (e) {
4612
- fn(e);
4613
n.blur(); // Remove focus outline for mouse users
4614
} )
4615
.bind( 'keypress.DT', oData, function (e){
4616
if ( e.which === 13 ) {
@@ -4627,9 +4813,9 @@
4627
* Register a callback function. Easily allows a callback function to be added to
4628
* an array store of callback functions that can then all be called together.
4629
* @param {object} oSettings dataTables settings object
4630
- * @param {string} sStore Name of the array storeage for the callbacks in oSettings
4631
* @param {function} fn Function to be called back
4632
- * @param {string) sName Identifying name for the callback (i.e. a label)
4633
* @memberof DataTable#oApi
4634
*/
4635
function _fnCallbackReg( oSettings, sStore, fn, sName )
@@ -4649,10 +4835,10 @@
4649
* array store is done backwards! Further note that you do not want to fire off triggers
4650
* in time sensitive applications (for example cell creation) as its slow.
4651
* @param {object} oSettings dataTables settings object
4652
- * @param {string} sStore Name of the array storeage for the callbacks in oSettings
4653
* @param {string} sTrigger Name of the jQuery custom event to trigger. If null no trigger
4654
* is fired
4655
- * @param {array) aArgs Array of arguments to pass to the callback function / trigger
4656
* @memberof DataTable#oApi
4657
*/
4658
function _fnCallbackFire( oSettings, sStore, sTrigger, aArgs )
@@ -4677,7 +4863,7 @@
4677
/**
4678
* JSON stringify. If JSON.stringify it provided by the browser, json2.js or any other
4679
* library, then we use that as it is fast, safe and accurate. If the function isn't
4680
- * available then we need to built it ourselves - the insperation for this function comes
4681
* from Craig Buckler ( http://www.sitepoint.com/javascript-json-serialization/ ). It is
4682
* not perfect and absolutely should not be used as a replacement to json2.js - but it does
4683
* do what we need, without requiring a dependency for DataTables.
@@ -4725,9 +4911,32 @@
4725
return (bArr ? "[" : "{") + json + (bArr ? "]" : "}");
4726
};
4727
4728
-
4729
4730
4731
/**
4732
* Perform a jQuery selector action on the table's TR elements (from the tbody) and
4733
* return the resulting jQuery object.
@@ -4765,8 +4974,11 @@
4765
*/
4766
this.$ = function ( sSelector, oOpts )
4767
{
4768
- var i, iLen, a = [];
4769
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
4770
4771
if ( !oOpts )
4772
{
@@ -4785,37 +4997,54 @@
4785
{
4786
for ( i=oSettings._iDisplayStart, iLen=oSettings.fnDisplayEnd() ; i<iLen ; i++ )
4787
{
4788
- a.push( oSettings.aoData[ oSettings.aiDisplay[i] ].nTr );
4789
}
4790
}
4791
else if ( oOpts.order == "current" && oOpts.filter == "none" )
4792
{
4793
- for ( i=0, iLen=oSettings.aiDisplayMaster.length ; i<iLen ; i++ )
4794
{
4795
- a.push( oSettings.aoData[ oSettings.aiDisplayMaster[i] ].nTr );
4796
}
4797
}
4798
else if ( oOpts.order == "current" && oOpts.filter == "applied" )
4799
{
4800
- for ( i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
4801
{
4802
- a.push( oSettings.aoData[ oSettings.aiDisplay[i] ].nTr );
4803
}
4804
}
4805
else if ( oOpts.order == "original" && oOpts.filter == "none" )
4806
{
4807
- for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
4808
{
4809
- a.push( oSettings.aoData[ i ].nTr );
4810
}
4811
}
4812
else if ( oOpts.order == "original" && oOpts.filter == "applied" )
4813
{
4814
- for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
4815
{
4816
- if ( $.inArray( i, oSettings.aiDisplay ) !== -1 )
4817
{
4818
- a.push( oSettings.aoData[ i ].nTr );
4819
}
4820
}
4821
}
@@ -4839,11 +5068,11 @@
4839
/**
4840
* Almost identical to $ in operation, but in this case returns the data for the matched
4841
* rows - as such, the jQuery selector used should match TR row nodes or TD/TH cell nodes
4842
- * rather than any decendents, so the data can be obtained for the row/cell. If matching
4843
* rows are found, the data returned is the original data array/object that was used to
4844
* create the row (or a generated array if from a DOM source).
4845
*
4846
- * This method is often useful incombination with $ where both functions are given the
4847
* same parameters and the array indexes will match identically.
4848
* @param {string|node|jQuery} sSelector jQuery selector or node collection to act on
4849
* @param {object} [oOpts] Optional parameters for modifying the rows to be included
@@ -4907,8 +5136,8 @@
4907
* <ul>
4908
* <li>1D array of data - add a single row with the data provided</li>
4909
* <li>2D array of arrays - add multiple rows in a single call</li>
4910
- * <li>object - data object when using <i>mDataProp</i></li>
4911
- * <li>array of objects - multiple data objects when using <i>mDataProp</i></li>
4912
* </ul>
4913
* @param {bool} [bRedraw=true] redraw the table or not
4914
* @returns {array} An array of integers, representing the list of indexes in
@@ -5142,8 +5371,8 @@
5142
fnCallBack.call( this, oSettings, oData );
5143
}
5144
5145
- /* Check for an 'overflow' they case for dislaying the table */
5146
- if ( oSettings._iDisplayStart >= oSettings.aiDisplay.length )
5147
{
5148
oSettings._iDisplayStart -= oSettings._iDisplayLength;
5149
if ( oSettings._iDisplayStart < 0 )
@@ -5182,22 +5411,23 @@
5182
var nBody = oSettings.nTBody;
5183
var i, iLen;
5184
5185
- bRemove = (bRemove===undefined) ? false : true;
5186
5187
/* Flag to note that the table is currently being destroyed - no action should be taken */
5188
oSettings.bDestroying = true;
5189
5190
- /* Restore hidden columns */
5191
- for ( i=0, iLen=oSettings.aoDestroyCallback.length ; i<iLen ; i++ ) {
5192
- oSettings.aoDestroyCallback[i].fn();
5193
- }
5194
-
5195
- /* Restore hidden columns */
5196
- for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
5197
{
5198
- if ( oSettings.aoColumns[i].bVisible === false )
5199
{
5200
- this.fnSetColumnVis( i, true );
5201
}
5202
}
5203
@@ -5273,12 +5503,19 @@
5273
oSettings.nTable.style.width = _fnStringToCss(oSettings.sDestroyWidth);
5274
}
5275
5276
- /* If the were originally odd/even type classes - then we add them back here. Note
5277
- * this is not fool proof (for example if not all rows as odd/even classes - but
5278
* it's a good effort without getting carried away
5279
*/
5280
- $(nBody).children('tr:even').addClass( oSettings.asDestroyStripes[0] );
5281
- $(nBody).children('tr:odd').addClass( oSettings.asDestroyStripes[1] );
5282
5283
/* Remove the settings object from the settings array */
5284
for ( i=0, iLen=DataTable.settings.length ; i<iLen ; i++ )
@@ -5291,6 +5528,7 @@
5291
5292
/* End it all */
5293
oSettings = null;
5294
};
5295
5296
@@ -5310,7 +5548,7 @@
5310
this.fnDraw = function( bComplete )
5311
{
5312
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
5313
- if ( bComplete )
5314
{
5315
_fnCalculateEnd( oSettings );
5316
_fnDraw( oSettings );
@@ -5384,7 +5622,17 @@
5384
var n = oSettings.aanFeatures.f;
5385
for ( var i=0, iLen=n.length ; i<iLen ; i++ )
5386
{
5387
- $('input', n[i]).val( sInput );
5388
}
5389
}
5390
}
@@ -5504,7 +5752,8 @@
5504
* and column index including hidden columns
5505
* @param {node} nNode this can either be a TR, TD or TH in the table's body
5506
* @returns {int} If nNode is given as a TR, then a single index is returned, or
5507
- * if given as a cell, an array of [row index, column index (visible)] is given.
5508
* @dtopt API
5509
*
5510
* @example
@@ -5706,7 +5955,7 @@
5706
var i, iLen;
5707
var aoColumns = oSettings.aoColumns;
5708
var aoData = oSettings.aoData;
5709
- var nTd, nCell, anTrs, jqChildren, bAppend, iBefore;
5710
5711
/* No point in doing anything if we are requesting what is already true */
5712
if ( aoColumns[iCol].bVisible == bShow )
@@ -5826,7 +6075,7 @@
5826
5827
5828
/**
5829
- * Sort the table by a particular row
5830
* @param {int} iCol the data index to sort on. Note that this will not match the
5831
* 'display index' if you have hidden data entries
5832
* @dtopt API
@@ -5878,7 +6127,7 @@
5878
* @param {node|int} mRow TR element you want to update or the aoData index
5879
* @param {int} [iColumn] The column to update (not used of mData is an array or object)
5880
* @param {bool} [bRedraw=true] Redraw the table or not
5881
- * @param {bool} [bAction=true] Perform predraw actions or not
5882
* @returns {int} 0 on success, 1 on error
5883
* @dtopt API
5884
*
@@ -5892,34 +6141,30 @@
5892
this.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction )
5893
{
5894
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
5895
- var iVisibleColumn, i, iLen, sDisplay;
5896
var iRow = (typeof mRow === 'object') ?
5897
_fnNodeToDataIndex(oSettings, mRow) : mRow;
5898
5899
- if ( oSettings.__fnUpdateDeep === undefined && $.isArray(mData) && typeof mData === 'object' )
5900
{
5901
/* Array update - update the whole row */
5902
oSettings.aoData[iRow]._aData = mData.slice();
5903
5904
/* Flag to the function that we are recursing */
5905
- oSettings.__fnUpdateDeep = true;
5906
for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
5907
{
5908
this.fnUpdate( _fnGetCellData( oSettings, iRow, i ), iRow, i, false, false );
5909
}
5910
- oSettings.__fnUpdateDeep = undefined;
5911
}
5912
- else if ( oSettings.__fnUpdateDeep === undefined && mData !== null && typeof mData === 'object' )
5913
{
5914
/* Object update - update the whole row - assume the developer gets the object right */
5915
oSettings.aoData[iRow]._aData = $.extend( true, {}, mData );
5916
5917
- oSettings.__fnUpdateDeep = true;
5918
for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
5919
{
5920
this.fnUpdate( _fnGetCellData( oSettings, iRow, i ), iRow, i, false, false );
5921
}
5922
- oSettings.__fnUpdateDeep = undefined;
5923
}
5924
else
5925
{
@@ -5948,8 +6193,10 @@
5948
* will rebuild the search array - however, the redraw might be disabled by the user)
5949
*/
5950
var iDisplayIndex = $.inArray( iRow, oSettings.aiDisplay );
5951
- oSettings.asDataSearch[iDisplayIndex] = _fnBuildSearchRow( oSettings,
5952
- _fnGetRowData( oSettings, iRow, 'filter' ) );
5953
5954
/* Perform pre-draw actions */
5955
if ( bAction === undefined || bAction )
@@ -5987,7 +6234,7 @@
5987
5988
/*
5989
* This is really a good bit rubbish this method of exposing the internal methods
5990
- * publically... - To be fixed in 2.0 using methods on the prototype
5991
*/
5992
5993
@@ -6098,7 +6345,10 @@
6098
"_fnCallbackFire": _fnCallbackFire,
6099
"_fnJsonString": _fnJsonString,
6100
"_fnRender": _fnRender,
6101
- "_fnNodeToColumnIndex": _fnNodeToColumnIndex
6102
};
6103
6104
$.extend( DataTable.ext.oApi, this.oApi );
@@ -6113,8 +6363,7 @@
6113
6114
6115
var _that = this;
6116
- return this.each(function() {
6117
-
6118
var i=0, iLen, j, jLen, k, kLen;
6119
var sId = this.getAttribute( 'id' );
6120
var bInitHandedOff = false;
@@ -6166,7 +6415,7 @@
6166
}
6167
6168
/* Ensure the table has an ID - required for accessibility */
6169
- if ( sId === null )
6170
{
6171
sId = "DataTables_Table_"+(DataTable.ext._oExternConfig.iNextUnique++);
6172
this.id = sId;
@@ -6219,8 +6468,8 @@
6219
_fnMap( oSettings.oScroll, oInit, "bScrollInfinite", "bInfinite" );
6220
_fnMap( oSettings.oScroll, oInit, "iScrollLoadGap", "iLoadGap" );
6221
_fnMap( oSettings.oScroll, oInit, "bScrollAutoCss", "bAutoCss" );
6222
- _fnMap( oSettings, oInit, "asStripClasses", "asStripeClasses" ); // legacy
6223
_fnMap( oSettings, oInit, "asStripeClasses" );
6224
_fnMap( oSettings, oInit, "fnServerData" );
6225
_fnMap( oSettings, oInit, "fnFormatNumber" );
6226
_fnMap( oSettings, oInit, "sServerMethod" );
@@ -6313,8 +6562,9 @@
6313
if ( oInit.iDeferLoading !== null )
6314
{
6315
oSettings.bDeferLoading = true;
6316
- oSettings._iRecordsTotal = oInit.iDeferLoading;
6317
- oSettings._iRecordsDisplay = oInit.iDeferLoading;
6318
}
6319
6320
if ( oInit.aaData !== null )
@@ -6346,44 +6596,38 @@
6346
/*
6347
* Stripes
6348
*/
6349
-
6350
- /* Remove row stripe classes if they are already on the table row */
6351
- var bStripeRemove = false;
6352
- var anRows = $(this).children('tbody').children('tr');
6353
- for ( i=0, iLen=oSettings.asStripeClasses.length ; i<iLen ; i++ )
6354
{
6355
- if ( anRows.filter(":lt(2)").hasClass( oSettings.asStripeClasses[i]) )
6356
- {
6357
- bStripeRemove = true;
6358
- break;
6359
- }
6360
}
6361
-
6362
- if ( bStripeRemove )
6363
{
6364
- /* Store the classes which we are about to remove so they can be readded on destroy */
6365
- oSettings.asDestroyStripes = [ '', '' ];
6366
- if ( $(anRows[0]).hasClass(oSettings.oClasses.sStripeOdd) )
6367
- {
6368
- oSettings.asDestroyStripes[0] += oSettings.oClasses.sStripeOdd+" ";
6369
- }
6370
- if ( $(anRows[0]).hasClass(oSettings.oClasses.sStripeEven) )
6371
- {
6372
- oSettings.asDestroyStripes[0] += oSettings.oClasses.sStripeEven;
6373
- }
6374
- if ( $(anRows[1]).hasClass(oSettings.oClasses.sStripeOdd) )
6375
{
6376
- oSettings.asDestroyStripes[1] += oSettings.oClasses.sStripeOdd+" ";
6377
}
6378
- if ( $(anRows[1]).hasClass(oSettings.oClasses.sStripeEven) )
6379
{
6380
- oSettings.asDestroyStripes[1] += oSettings.oClasses.sStripeEven;
6381
}
6382
-
6383
- anRows.removeClass( oSettings.asStripeClasses.join(' ') );
6384
}
6385
6386
-
6387
/*
6388
* Columns
6389
* See if we should load columns automatically or use defined ones
@@ -6478,6 +6722,15 @@
6478
* Final init
6479
* Cache the header, body and footer as required, creating them if needed
6480
*/
6481
var thead = $(this).children('thead');
6482
if ( thead.length === 0 )
6483
{
@@ -6498,6 +6751,14 @@
6498
oSettings.nTBody.setAttribute( "aria-relevant", "all" );
6499
6500
var tfoot = $(this).children('tfoot');
6501
if ( tfoot.length > 0 )
6502
{
6503
oSettings.nTFoot = tfoot[0];
@@ -6532,7 +6793,108 @@
6532
_fnInitialise( oSettings );
6533
}
6534
} );
6535
};
6536
6537
/**
6538
* Version string for plug-ins to check compatibility. Allowed format is
@@ -6542,7 +6904,7 @@
6542
* @type string
6543
* @default Version number
6544
*/
6545
- DataTable.version = "1.9.0";
6546
6547
/**
6548
* Private data store, containing all of the settings objects that are created for the
@@ -6658,8 +7020,8 @@
6658
* </il>
6659
* </ul>
6660
*
6661
- * Note that as of v1.9, it is typically preferable to use <i>mDataProp</i> to prepare data for
6662
- * the different uses that DataTables can put the data to. Specifically <i>mDataProp</i> when
6663
* used as a function will give you a 'type' (sorting, filtering etc) that you can use to
6664
* prepare the data as required for the different types. As such, this method is deprecated.
6665
* @type array
@@ -6790,28 +7152,7 @@
6790
* alert( oTable.fnVersionCheck( '1.9.0' ) );
6791
* } );
6792
*/
6793
- "fnVersionCheck": function( sVersion )
6794
- {
6795
- /* This is cheap, but very effective */
6796
- var fnZPad = function (Zpad, count)
6797
- {
6798
- while(Zpad.length < count) {
6799
- Zpad += '0';
6800
- }
6801
- return Zpad;
6802
- };
6803
- var aThis = DataTable.ext.sVersion.split('.');
6804
- var aThat = sVersion.split('.');
6805
- var sThis = '', sThat = '';
6806
-
6807
- for ( var i=0, iLen=aThat.length ; i<iLen ; i++ )
6808
- {
6809
- sThis += fnZPad( aThis[i], 3 );
6810
- sThat += fnZPad( aThat[i], 3 );
6811
- }
6812
-
6813
- return parseInt(sThis, 10) >= parseInt(sThat, 10);
6814
- },
6815
6816
6817
/**
@@ -6845,8 +7186,8 @@
6845
* </il>
6846
* </ul>
6847
*
6848
- * Note that as of v1.9, it is typically preferable to use <i>mDataProp</i> to prepare data for
6849
- * the different uses that DataTables can put the data to. Specifically <i>mDataProp</i> when
6850
* used as a function will give you a 'type' (sorting, filtering etc) that you can use to
6851
* prepare the data as required for the different types. As such, this method is deprecated.
6852
* @type object
@@ -7173,7 +7514,7 @@
7173
/**
7174
* Data object from the original data source for the row. This is either
7175
* an array if using the traditional form of DataTables, or an object if
7176
- * using mDataProp options. The exact type will depend on the passed in
7177
* data from the data source, or will be an array if using DOM a data
7178
* source.
7179
* @type array|object
@@ -7267,14 +7608,14 @@
7267
"bSortable": null,
7268
7269
/**
7270
- * When using fnRender, you have two options for what to do with the data,
7271
- * and this property serves as the switch. Firstly, you can have the sorting
7272
- * and filtering use the rendered value (true - default), or you can have
7273
- * the sorting and filtering us the original value (false).
7274
- *
7275
- * *NOTE* It is it is advisable now to use mDataProp as a function and make
7276
- * use of the 'type' that it gives, allowing (potentially) different data to
7277
- * be used for sorting, filtering, display and type detection.
7278
* @type boolean
7279
* @deprecated
7280
*/
@@ -7297,9 +7638,9 @@
7297
7298
/**
7299
* Developer definable function that is called whenever a cell is created (Ajax source,
7300
- * etc) or processed for input (DOM source). This can be used as a compliment to fnRender
7301
* allowing you to modify the DOM element (add background colour for example) when the
7302
- * element is available (since it is not when fnRender is called).
7303
* @type function
7304
* @param {element} nTd The TD node that has been created
7305
* @param {*} sData The Data for the cell
@@ -7312,7 +7653,7 @@
7312
/**
7313
* Function to get data from a cell in a column. You should <b>never</b>
7314
* access data directly through _aData internally in DataTables - always use
7315
- * the method attached to this property. It allows mDataProp to function as
7316
* required. This function is automatically assigned by the column
7317
* initialisation method
7318
* @type function
@@ -7326,23 +7667,28 @@
7326
"fnGetData": null,
7327
7328
/**
7329
- * Custom display function that will be called for the display of each cell
7330
- * in this column.
7331
* @type function
7332
* @param {object} o Object with the following parameters:
7333
* @param {int} o.iDataRow The row in aoData
7334
* @param {int} o.iDataColumn The column in question
7335
- * @param {array o.aData The data for the row in question
7336
* @param {object} o.oSettings The settings object for this DataTables instance
7337
* @returns {string} The string you which to use in the display
7338
* @default null
7339
*/
7340
"fnRender": null,
7341
7342
/**
7343
* Function to set data for a cell in the column. You should <b>never</b>
7344
* set the data directly to _aData internally in DataTables - always use
7345
- * this method. It allows mDataProp to function as required. This function
7346
* is automatically assigned by the column initialisation method
7347
* @type function
7348
* @param {array|object} oData The data array/object for the array
@@ -7359,7 +7705,17 @@
7359
* @type function|int|string|null
7360
* @default null
7361
*/
7362
- "mDataProp": null,
7363
7364
/**
7365
* Unique header TH/TD element for this column - this is what the sorting
@@ -7400,7 +7756,7 @@
7400
7401
/**
7402
* Allows a default value to be given for a column's data, and will be used
7403
- * whenever a null data source is encountered (this can be because mDataProp
7404
* is set to null, or because the data source itself is null).
7405
* @type string
7406
* @default null
@@ -7501,7 +7857,7 @@
7501
* } );
7502
*
7503
* @example
7504
- * // Using an array of objects as a data source (mDataProp)
7505
* $(document).ready( function () {
7506
* $('#example').dataTable( {
7507
* "aaData": [
@@ -7521,11 +7877,11 @@
7521
* }
7522
* ],
7523
* "aoColumns": [
7524
- * { "sTitle": "Engine", "mDataProp": "engine" },
7525
- * { "sTitle": "Browser", "mDataProp": "browser" },
7526
- * { "sTitle": "Platform", "mDataProp": "platform" },
7527
- * { "sTitle": "Version", "mDataProp": "version" },
7528
- * { "sTitle": "Grade", "mDataProp": "grade" }
7529
* ]
7530
* } );
7531
* } );
@@ -7594,7 +7950,7 @@
7594
* @dtopt Option
7595
*
7596
* @example
7597
- * $(document).ready(function() {
7598
* $('#example').dataTable( {
7599
* "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
7600
* } );
@@ -7604,7 +7960,7 @@
7604
* // Setting the default display length as well as length menu
7605
* // This is likely to be wanted if you remove the '10' option which
7606
* // is the iDisplayLength default.
7607
- * $(document).ready(function() {
7608
* $('#example').dataTable( {
7609
* "iDisplayLength": 25,
7610
* "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]]
@@ -7676,7 +8032,8 @@
7676
* array may be of any length, and DataTables will apply each class
7677
* sequentially, looping when required.
7678
* @type array
7679
- * @default [ 'odd', 'even' ]
7680
* @dtopt Option
7681
*
7682
* @example
@@ -7686,7 +8043,7 @@
7686
* } );
7687
* } )
7688
*/
7689
- "asStripeClasses": [ 'odd', 'even' ],
7690
7691
7692
/**
@@ -7718,7 +8075,7 @@
7718
* @dtopt Features
7719
*
7720
* @example
7721
- * $(document).ready(function() {
7722
* var oTable = $('#example').dataTable( {
7723
* "sAjaxSource": "sources/arrays.txt",
7724
* "bDeferRender": true
@@ -7738,7 +8095,7 @@
7738
* @dtopt Options
7739
*
7740
* @example
7741
- * $(document).ready(function() {
7742
* $('#example').dataTable( {
7743
* "sScrollY": "200px",
7744
* "bPaginate": false
@@ -7761,7 +8118,7 @@
7761
* specified (this allow matching across multiple columns). Note that if you
7762
* wish to use filtering in DataTables this must remain 'true' - to remove the
7763
* default filtering input box and retain filtering abilities, please use
7764
- * @ref{sDom}.
7765
* @type boolean
7766
* @default true
7767
* @dtopt Features
@@ -7877,7 +8234,7 @@
7877
* @dtopt Options
7878
*
7879
* @example
7880
- * $(document).ready(function() {
7881
* initTable();
7882
* tableActions();
7883
* } );
@@ -7909,7 +8266,7 @@
7909
* @dtopt Options
7910
*
7911
* @example
7912
- * $(document).ready(function() {
7913
* $('#example').dataTable( {
7914
* "bScrollAutoCss": false,
7915
* "sScrollY": "200px"
@@ -7931,7 +8288,7 @@
7931
* @dtopt Options
7932
*
7933
* @example
7934
- * $(document).ready(function() {
7935
* $('#example').dataTable( {
7936
* "sScrollY": "200",
7937
* "bScrollCollapse": true
@@ -7953,7 +8310,7 @@
7953
* @dtopt Features
7954
*
7955
* @example
7956
- * $(document).ready(function() {
7957
* $('#example').dataTable( {
7958
* "bScrollInfinite": true,
7959
* "bScrollCollapse": true,
@@ -8010,7 +8367,7 @@
8010
* @dtopt Options
8011
*
8012
* @example
8013
- * $(document).ready(function() {
8014
* $('#example').dataTable( {
8015
* "bSortCellsTop": true
8016
* } );
@@ -8097,7 +8454,7 @@
8097
* @dtopt Callbacks
8098
*
8099
* @example
8100
- * $(document).ready(function() {
8101
* $('#example').dataTable( {
8102
* "fnCreatedRow": function( nRow, aData, iDataIndex ) {
8103
* // Bold the grade for all 'A' grade browsers
@@ -8122,7 +8479,7 @@
8122
* @example
8123
* $(document).ready( function() {
8124
* $('#example').dataTable( {
8125
- * "fnDrawCallback": function() {
8126
* alert( 'DataTables has redrawn the table' );
8127
* }
8128
* } );
@@ -8170,7 +8527,7 @@
8170
* @dtopt Callbacks
8171
*
8172
* @example
8173
- * $(document).ready(function() {
8174
* $('#example').dataTable( {
8175
* "fnFormatNumber": function ( iIn ) {
8176
* if ( iIn &lt; 1000 ) {
@@ -8329,7 +8686,7 @@
8329
* @dtopt Callbacks
8330
*
8331
* @example
8332
- * $(document).ready(function() {
8333
* $('#example').dataTable( {
8334
* "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
8335
* // Bold the grade for all 'A' grade browsers
@@ -8362,13 +8719,13 @@
8362
*
8363
* @example
8364
* // POST data to server
8365
- * $(document).ready(function() {
8366
* $('#example').dataTable( {
8367
* "bProcessing": true,
8368
* "bServerSide": true,
8369
* "sAjaxSource": "xhr.php",
8370
- * "fnServerData": function ( sSource, aoData, fnCallback ) {
8371
- * $.ajax( {
8372
* "dataType": 'json',
8373
* "type": "POST",
8374
* "url": sSource,
@@ -8384,7 +8741,11 @@
8384
"url": sUrl,
8385
"data": aoData,
8386
"success": function (json) {
8387
- $(oSettings.oInstance).trigger('xhr', oSettings);
8388
fnCallback( json );
8389
},
8390
"dataType": "json",
@@ -8392,8 +8753,8 @@
8392
"type": oSettings.sServerMethod,
8393
"error": function (xhr, error, thrown) {
8394
if ( error == "parsererror" ) {
8395
- alert( "DataTables warning: JSON data from server could not be parsed. "+
8396
- "This is caused by a JSON formatting error." );
8397
}
8398
}
8399
} );
@@ -8418,7 +8779,7 @@
8418
* @dtopt Server-side
8419
*
8420
* @example
8421
- * $(document).ready(function() {
8422
* $('#example').dataTable( {
8423
* "bProcessing": true,
8424
* "bServerSide": true,
@@ -8443,10 +8804,10 @@
8443
* @dtopt Callbacks
8444
*
8445
* @example
8446
- * $(document).ready(function() {
8447
* $('#example').dataTable( {
8448
* "bStateSave": true,
8449
- * "fnStateSave": function (oSettings, oData) {
8450
* var o;
8451
*
8452
* // Send an Ajax request to the server to get the data. Note that
@@ -8493,21 +8854,23 @@
8493
*
8494
* @example
8495
* // Remove a saved filter, so filtering is never loaded
8496
- * $(document).ready(function() {
8497
* $('#example').dataTable( {
8498
* "bStateSave": true,
8499
* "fnStateLoadParams": function (oSettings, oData) {
8500
- * oData.oFilter.sSearch = "";
8501
* } );
8502
* } );
8503
*
8504
* @example
8505
* // Disallow state loading by returning false
8506
- * $(document).ready(function() {
8507
* $('#example').dataTable( {
8508
* "bStateSave": true,
8509
* "fnStateLoadParams": function (oSettings, oData) {
8510
* return false;
8511
* } );
8512
* } );
8513
*/
@@ -8524,11 +8887,12 @@
8524
*
8525
* @example
8526
* // Show an alert with the filtering value that was saved
8527
- * $(document).ready(function() {
8528
* $('#example').dataTable( {
8529
* "bStateSave": true,
8530
* "fnStateLoaded": function (oSettings, oData) {
8531
- * alert( 'Saved filter was: '+oData.oFilter.sSearch );
8532
* } );
8533
* } );
8534
*/
@@ -8546,7 +8910,7 @@
8546
* @dtopt Callbacks
8547
*
8548
* @example
8549
- * $(document).ready(function() {
8550
* $('#example').dataTable( {
8551
* "bStateSave": true,
8552
* "fnStateSave": function (oSettings, oData) {
@@ -8586,11 +8950,12 @@
8586
*
8587
* @example
8588
* // Remove a saved filter, so filtering is never saved
8589
- * $(document).ready(function() {
8590
* $('#example').dataTable( {
8591
* "bStateSave": true,
8592
- * "fnStateLoadParams": function (oSettings, oData) {
8593
- * oData.oFilter.sSearch = "";
8594
* } );
8595
* } );
8596
*/
@@ -8607,7 +8972,7 @@
8607
* @example
8608
* $(document).ready( function() {
8609
* $('#example').dataTable( {
8610
- * "iCookieDuration": 60*60*24 // 1 day
8611
* } );
8612
* } )
8613
*/
@@ -8620,19 +8985,38 @@
8620
* will be applied to it), thus saving on an XHR at load time. iDeferLoading
8621
* is used to indicate that deferred loading is required, but it is also used
8622
* to tell DataTables how many records there are in the full table (allowing
8623
- * the information element and pagination to be displayed correctly).
8624
- * @type int
8625
* @default null
8626
* @dtopt Options
8627
*
8628
* @example
8629
- * $(document).ready(function() {
8630
* $('#example').dataTable( {
8631
* "bServerSide": true,
8632
* "sAjaxSource": "scripts/server_processing.php",
8633
* "iDeferLoading": 57
8634
* } );
8635
* } );
8636
*/
8637
"iDeferLoading": null,
8638
@@ -8684,7 +9068,7 @@
8684
* @dtopt Options
8685
*
8686
* @example
8687
- * $(document).ready(function() {
8688
* $('#example').dataTable( {
8689
* "bScrollInfinite": true,
8690
* "bScrollCollapse": true,
@@ -8708,7 +9092,7 @@
8708
* @dtopt Options
8709
*
8710
* @example
8711
- * $(document).ready(function() {
8712
* $('#example').dataTable( {
8713
* "iTabIndex": 1
8714
* } );
@@ -8740,7 +9124,7 @@
8740
* @dtopt Language
8741
*
8742
* @example
8743
- * $(document).ready(function() {
8744
* $('#example').dataTable( {
8745
* "oLanguage": {
8746
* "oAria": {
@@ -8761,7 +9145,7 @@
8761
* @dtopt Language
8762
*
8763
* @example
8764
- * $(document).ready(function() {
8765
* $('#example').dataTable( {
8766
* "oLanguage": {
8767
* "oAria": {
@@ -8788,7 +9172,7 @@
8788
* @dtopt Language
8789
*
8790
* @example
8791
- * $(document).ready(function() {
8792
* $('#example').dataTable( {
8793
* "oLanguage": {
8794
* "oPaginate": {
@@ -8809,7 +9193,7 @@
8809
* @dtopt Language
8810
*
8811
* @example
8812
- * $(document).ready(function() {
8813
* $('#example').dataTable( {
8814
* "oLanguage": {
8815
* "oPaginate": {
@@ -8823,14 +9207,14 @@
8823
8824
8825
/**
8826
- * Text to use when using the 'full_numbers' type of pagination for the
8827
- * button to take the user to the next page.
8828
* @type string
8829
* @default Next
8830
* @dtopt Language
8831
*
8832
* @example
8833
- * $(document).ready(function() {
8834
* $('#example').dataTable( {
8835
* "oLanguage": {
8836
* "oPaginate": {
@@ -8844,14 +9228,14 @@
8844
8845
8846
/**
8847
- * Text to use when using the 'full_numbers' type of pagination for the
8848
- * button to take the user to the previous page.
8849
* @type string
8850
* @default Previous
8851
* @dtopt Language
8852
*
8853
* @example
8854
- * $(document).ready(function() {
8855
* $('#example').dataTable( {
8856
* "oLanguage": {
8857
* "oPaginate": {
@@ -8874,7 +9258,7 @@
8874
* @dtopt Language
8875
*
8876
* @example
8877
- * $(document).ready(function() {
8878
* $('#example').dataTable( {
8879
* "oLanguage": {
8880
* "sEmptyTable": "No data available in table"
@@ -8895,7 +9279,7 @@
8895
* @dtopt Language
8896
*
8897
* @example
8898
- * $(document).ready(function() {
8899
* $('#example').dataTable( {
8900
* "oLanguage": {
8901
* "sInfo": "Got a total of _TOTAL_ entries to show (_START_ to _END_)"
@@ -8914,7 +9298,7 @@
8914
* @dtopt Language
8915
*
8916
* @example
8917
- * $(document).ready(function() {
8918
* $('#example').dataTable( {
8919
* "oLanguage": {
8920
* "sInfoEmpty": "No entries to show"
@@ -8934,7 +9318,7 @@
8934
* @dtopt Language
8935
*
8936
* @example
8937
- * $(document).ready(function() {
8938
* $('#example').dataTable( {
8939
* "oLanguage": {
8940
* "sInfoFiltered": " - filtering from _MAX_ records"
@@ -8955,7 +9339,7 @@
8955
* @dtopt Language
8956
*
8957
* @example
8958
- * $(document).ready(function() {
8959
* $('#example').dataTable( {
8960
* "oLanguage": {
8961
* "sInfoPostFix": "All records shown are derived from real information."
@@ -8976,7 +9360,7 @@
8976
* @dtopt Language
8977
*
8978
* @example
8979
- * $(document).ready(function() {
8980
* $('#example').dataTable( {
8981
* "oLanguage": {
8982
* "sInfoThousands": "'"
@@ -8998,7 +9382,7 @@
8998
*
8999
* @example
9000
* // Language change only
9001
- * $(document).ready(function() {
9002
* $('#example').dataTable( {
9003
* "oLanguage": {
9004
* "sLengthMenu": "Display _MENU_ records"
@@ -9008,7 +9392,7 @@
9008
*
9009
* @example
9010
* // Language and options change
9011
- * $(document).ready(function() {
9012
* $('#example').dataTable( {
9013
* "oLanguage": {
9014
* "sLengthMenu": 'Display <select>'+
@@ -9056,7 +9440,7 @@
9056
* @dtopt Language
9057
*
9058
* @example
9059
- * $(document).ready(function() {
9060
* $('#example').dataTable( {
9061
* "oLanguage": {
9062
* "sProcessing": "DataTables is currently busy"
@@ -9079,7 +9463,7 @@
9079
*
9080
* @example
9081
* // Input text box will be appended at the end automatically
9082
- * $(document).ready(function() {
9083
* $('#example').dataTable( {
9084
* "oLanguage": {
9085
* "sSearch": "Filter records:"
@@ -9089,7 +9473,7 @@
9089
*
9090
* @example
9091
* // Specify where the filter should appear
9092
- * $(document).ready(function() {
9093
* $('#example').dataTable( {
9094
* "oLanguage": {
9095
* "sSearch": "Apply filter _INPUT_ to table"
@@ -9112,7 +9496,7 @@
9112
* @dtopt Language
9113
*
9114
* @example
9115
- * $(document).ready(function() {
9116
* $('#example').dataTable( {
9117
* "oLanguage": {
9118
* "sUrl": "http://www.sprymedia.co.uk/dataTables/lang.txt"
@@ -9132,7 +9516,7 @@
9132
* @dtopt Language
9133
*
9134
* @example
9135
- * $(document).ready(function() {
9136
* $('#example').dataTable( {
9137
* "oLanguage": {
9138
* "sZeroRecords": "No records to display"
@@ -9178,7 +9562,7 @@
9178
*
9179
* @example
9180
* // Get data from { "data": [...] }
9181
- * $(document).ready(function() {
9182
* var oTable = $('#example').dataTable( {
9183
* "sAjaxSource": "sources/data.txt",
9184
* "sAjaxDataProp": "data"
@@ -9187,7 +9571,7 @@
9187
*
9188
* @example
9189
* // Get data from { "data": { "inner": [...] } }
9190
- * $(document).ready(function() {
9191
* var oTable = $('#example').dataTable( {
9192
* "sAjaxSource": "sources/data.txt",
9193
* "sAjaxDataProp": "data.inner"
@@ -9225,7 +9609,7 @@
9225
* @dtopt Options
9226
*
9227
* @example
9228
- * $(document).ready(function() {
9229
* $('#example').dataTable( {
9230
* "sCookiePrefix": "my_datatable_",
9231
* } );
@@ -9277,9 +9661,9 @@
9277
* @dtopt Options
9278
*
9279
* @example
9280
- * $(document).ready(function() {
9281
* $('#example').dataTable( {
9282
- * "sDom": '&lt;"top"i&gt;rt&lt;"bottom"flp&gt;&lt;"clear"&lgt;'
9283
* } );
9284
* } );
9285
*/
@@ -9308,14 +9692,14 @@
9308
* Enable horizontal scrolling. When a table is too wide to fit into a certain
9309
* layout, or you have a large number of columns in the table, you can enable
9310
* x-scrolling to show the table in a viewport, which can be scrolled. This
9311
- * property can by any CSS unit, or a number (in which case it will be treated
9312
* as a pixel measurement).
9313
* @type string
9314
* @default <i>blank string - i.e. disabled</i>
9315
* @dtopt Features
9316
*
9317
* @example
9318
- * $(document).ready(function() {
9319
* $('#example').dataTable( {
9320
* "sScrollX": "100%",
9321
* "bScrollCollapse": true
@@ -9337,7 +9721,7 @@
9337
* @dtopt Options
9338
*
9339
* @example
9340
- * $(document).ready(function() {
9341
* $('#example').dataTable( {
9342
* "sScrollX": "100%",
9343
* "sScrollXInner": "110%"
@@ -9349,17 +9733,17 @@
9349
9350
/**
9351
* Enable vertical scrolling. Vertical scrolling will constrain the DataTable
9352
- * to the given height, an enable scrolling for any data which overflows the
9353
* current viewport. This can be used as an alternative to paging to display
9354
* a lot of data in a small area (although paging and scrolling can both be
9355
- * enabled at the same time). This property can by any CSS unit, or a number
9356
* (in which case it will be treated as a pixel measurement).
9357
* @type string
9358
* @default <i>blank string - i.e. disabled</i>
9359
* @dtopt Features
9360
*
9361
* @example
9362
- * $(document).ready(function() {
9363
* $('#example').dataTable( {
9364
* "sScrollY": "200px",
9365
* "bPaginate": false
@@ -9378,7 +9762,7 @@
9378
* @dtopt Server-side
9379
*
9380
* @example
9381
- * $(document).ready(function() {
9382
* $('#example').dataTable( {
9383
* "bServerSide": true,
9384
* "sAjaxSource": "scripts/post.php",
@@ -9406,7 +9790,7 @@
9406
*
9407
* @example
9408
* // Using aoColumnDefs
9409
- * $(document).ready(function() {
9410
* $('#example').dataTable( {
9411
* "aoColumnDefs": [
9412
* { "aDataSort": [ 0, 1 ], "aTargets": [ 0 ] },
@@ -9418,7 +9802,7 @@
9418
*
9419
* @example
9420
* // Using aoColumns
9421
- * $(document).ready(function() {
9422
* $('#example').dataTable( {
9423
* "aoColumns": [
9424
* { "aDataSort": [ 0, 1 ] },
@@ -9443,7 +9827,7 @@
9443
*
9444
* @example
9445
* // Using aoColumnDefs
9446
- * $(document).ready(function() {
9447
* $('#example').dataTable( {
9448
* "aoColumnDefs": [
9449
* { "asSorting": [ "asc" ], "aTargets": [ 1 ] },
@@ -9455,7 +9839,7 @@
9455
*
9456
* @example
9457
* // Using aoColumns
9458
- * $(document).ready(function() {
9459
* $('#example').dataTable( {
9460
* "aoColumns": [
9461
* null,
@@ -9478,7 +9862,7 @@
9478
*
9479
* @example
9480
* // Using aoColumnDefs
9481
- * $(document).ready(function() {
9482
* $('#example').dataTable( {
9483
* "aoColumnDefs": [
9484
* { "bSearchable": false, "aTargets": [ 0 ] }
@@ -9487,7 +9871,7 @@
9487
*
9488
* @example
9489
* // Using aoColumns
9490
- * $(document).ready(function() {
9491
* $('#example').dataTable( {
9492
* "aoColumns": [
9493
* { "bSearchable": false },
@@ -9509,7 +9893,7 @@
9509
*
9510
* @example
9511
* // Using aoColumnDefs
9512
- * $(document).ready(function() {
9513
* $('#example').dataTable( {
9514
* "aoColumnDefs": [
9515
* { "bSortable": false, "aTargets": [ 0 ] }
@@ -9518,7 +9902,7 @@
9518
*
9519
* @example
9520
* // Using aoColumns
9521
- * $(document).ready(function() {
9522
* $('#example').dataTable( {
9523
* "aoColumns": [
9524
* { "bSortable": false },
@@ -9533,51 +9917,18 @@
9533
9534
9535
/**
9536
- * When using fnRender() for a column, you may wish to use the original data
9537
- * (before rendering) for sorting and filtering (the default is to used the
9538
- * rendered data that the user can see). This may be useful for dates etc.
9539
*
9540
- * *NOTE* It is it is advisable now to use mDataProp as a function and make
9541
- * use of the 'type' that it gives, allowing (potentially) different data to
9542
- * be used for sorting, filtering, display and type detection.
9543
* @type boolean
9544
* @default true
9545
* @dtopt Columns
9546
- *
9547
- * @example
9548
- * // Using aoColumnDefs
9549
- * $(document).ready(function() {
9550
- * $('#example').dataTable( {
9551
- * "aoColumnDefs": [
9552
- * {
9553
- * "fnRender": function ( oObj ) {
9554
- * return oObj.aData[0] +' '+ oObj.aData[3];
9555
- * },
9556
- * "bUseRendered": false,
9557
- * "aTargets": [ 0 ]
9558
- * }
9559
- * ]
9560
- * } );
9561
- * } );
9562
- *
9563
- * @example
9564
- * // Using aoColumns
9565
- * $(document).ready(function() {
9566
- * $('#example').dataTable( {
9567
- * "aoColumns": [
9568
- * {
9569
- * "fnRender": function ( oObj ) {
9570
- * return oObj.aData[0] +' '+ oObj.aData[3];
9571
- * },
9572
- * "bUseRendered": false
9573
- * },
9574
- * null,
9575
- * null,
9576
- * null,
9577
- * null
9578
- * ]
9579
- * } );
9580
- * } );
9581
*/
9582
"bUseRendered": true,
9583
@@ -9590,7 +9941,7 @@
9590
*
9591
* @example
9592
* // Using aoColumnDefs
9593
- * $(document).ready(function() {
9594
* $('#example').dataTable( {
9595
* "aoColumnDefs": [
9596
* { "bVisible": false, "aTargets": [ 0 ] }
@@ -9599,7 +9950,7 @@
9599
*
9600
* @example
9601
* // Using aoColumns
9602
- * $(document).ready(function() {
9603
* $('#example').dataTable( {
9604
* "aoColumns": [
9605
* { "bVisible": false },
@@ -9615,9 +9966,9 @@
9615
9616
/**
9617
* Developer definable function that is called whenever a cell is created (Ajax source,
9618
- * etc) or processed for input (DOM source). This can be used as a compliment to fnRender
9619
* allowing you to modify the DOM element (add background colour for example) when the
9620
- * element is available (since it is not when fnRender is called).
9621
* @type function
9622
* @param {element} nTd The TD node that has been created
9623
* @param {*} sData The Data for the cell
@@ -9627,7 +9978,7 @@
9627
* @dtopt Columns
9628
*
9629
* @example
9630
- * $(document).ready(function() {
9631
* $('#example').dataTable( {
9632
* "aoColumnDefs": [ {
9633
* "aTargets": [3],
@@ -9644,8 +9995,12 @@
9644
9645
9646
/**
9647
- * Custom display function that will be called for the display of each cell in
9648
- * this column.
9649
* @type function
9650
* @param {object} o Object with the following parameters:
9651
* @param {int} o.iDataRow The row in aoData
@@ -9656,37 +10011,7 @@
9656
* @param {*} val The current cell value
9657
* @returns {string} The string you which to use in the display
9658
* @dtopt Columns
9659
- *
9660
- * @example
9661
- * // Using aoColumnDefs
9662
- * $(document).ready(function() {
9663
- * $('#example').dataTable( {
9664
- * "aoColumnDefs": [
9665
- * {
9666
- * "fnRender": function ( o, val ) {
9667
- * return o.aData[0] +' '+ o.aData[3];
9668
- * },
9669
- * "aTargets": [ 0 ]
9670
- * }
9671
- * ]
9672
- * } );
9673
- * } );
9674
- *
9675
- * @example
9676
- * // Using aoColumns
9677
- * $(document).ready(function() {
9678
- * $('#example').dataTable( {
9679
- * "aoColumns": [
9680
- * { "fnRender": function ( o, val ) {
9681
- * return o.aData[0] +' '+ o.aData[3];
9682
- * } },
9683
- * null,
9684
- * null,
9685
- * null,
9686
- * null
9687
- * ]
9688
- * } );
9689
- * } );
9690
*/
9691
"fnRender": null,
9692
@@ -9701,7 +10026,7 @@
9701
*
9702
* @example
9703
* // Using aoColumnDefs
9704
- * $(document).ready(function() {
9705
* $('#example').dataTable( {
9706
* "aoColumnDefs": [
9707
* { "iDataSort": 1, "aTargets": [ 0 ] }
@@ -9711,7 +10036,7 @@
9711
*
9712
* @example
9713
* // Using aoColumns
9714
- * $(document).ready(function() {
9715
* $('#example').dataTable( {
9716
* "aoColumns": [
9717
* { "iDataSort": 1 },
@@ -9726,61 +10051,76 @@
9726
"iDataSort": -1,
9727
9728
9729
/**
9730
* This property can be used to read data from any JSON data source property,
9731
- * including deeply nested objects / properties. mDataProp can be given in a
9732
* number of different ways which effect its behaviour:
9733
* <ul>
9734
* <li>integer - treated as an array index for the data source. This is the
9735
* default that DataTables uses (incrementally increased for each column).</li>
9736
* <li>string - read an object property from the data source. Note that you can
9737
- * use Javascript dotted notation to read deep properties/arrays from the
9738
* data source.</li>
9739
- * <li>null - the sDafaultContent option will use used for the cell (empty
9740
- * string by default. This can be useful on generated columns such as
9741
- * edit / delete action columns.</li>
9742
* <li>function - the function given will be executed whenever DataTables
9743
* needs to set or get the data for a cell in the column. The function
9744
* takes three parameters:
9745
* <ul>
9746
* <li>{array|object} The data source for the row</li>
9747
* <li>{string} The type call data requested - this will be 'set' when
9748
- * setting data or 'filter', 'display', 'type' or 'sort' when gathering
9749
- * data.</li>
9750
* <li>{*} Data to set when the second parameter is 'set'.</li>
9751
* </ul>
9752
* The return value from the function is not required when 'set' is the type
9753
* of call, but otherwise the return is what will be used for the data
9754
* requested.</li>
9755
* </ul>
9756
* @type string|int|function|null
9757
* @default null <i>Use automatically calculated column index</i>
9758
* @dtopt Columns
9759
*
9760
* @example
9761
* // Read table data from objects
9762
- * $(document).ready(function() {
9763
* var oTable = $('#example').dataTable( {
9764
* "sAjaxSource": "sources/deep.txt",
9765
* "aoColumns": [
9766
- * { "mDataProp": "engine" },
9767
- * { "mDataProp": "browser" },
9768
- * { "mDataProp": "platform.inner" },
9769
- * { "mDataProp": "platform.details.0" },
9770
- * { "mDataProp": "platform.details.1" }
9771
* ]
9772
* } );
9773
* } );
9774
*
9775
* @example
9776
- * // Using mDataProp as a function to provide different information for
9777
* // sorting, filtering and display. In this case, currency (price)
9778
- * $(document).ready(function() {
9779
* var oTable = $('#example').dataTable( {
9780
- * "aoColumnDefs": [
9781
- * {
9782
* "aTargets": [ 0 ],
9783
- * "mDataProp": function ( source, type, val ) {
9784
* if (type === 'set') {
9785
* source.price = val;
9786
* // Store the computed dislay and filter values for efficiency
@@ -9794,14 +10134,105 @@
9794
* else if (type === 'filter') {
9795
* return source.price_filter;
9796
* }
9797
- * // 'sort' and 'type' both just use the integer
9798
* return source.price;
9799
* }