org.wicketstuff.datatables.media.js.jquery.dataTables.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wicketstuff-datatables Show documentation
Show all versions of wicketstuff-datatables Show documentation
DataTables jQuery integration for Wicket
/*
* File: jquery.dataTables.js
* Version: 1.7.5
* Description: Paginate, search and sort HTML tables
* Author: Allan Jardine (www.sprymedia.co.uk)
* Created: 28/3/2008
* Language: Javascript
* License: GPL v2 or BSD 3 point style
* Project: Mtaala
* Contact: [email protected]
*
* Copyright 2008-2010 Allan Jardine, all rights reserved.
*
* This source file is free software, under either the GPL v2 license or a
* BSD style license, as supplied with this software.
*
* This source file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
*
* For details please refer to: http://www.datatables.net
*/
/*
* When considering jsLint, we need to allow eval() as it it is used for reading cookies and
* building the dynamic multi-column sort functions.
*/
/*jslint evil: true, undef: true, browser: true */
/*globals $, jQuery,_fnExternApiFunc,_fnInitalise,_fnInitComplete,_fnLanguageProcess,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnGatherData,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxUpdateDraw,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAjustColumnSizing,_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,_fnArrayCmp,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap*/
(function($, window, document) {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Section - DataTables variables
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Variable: dataTableSettings
* Purpose: Store the settings for each dataTables instance
* Scope: jQuery.fn
*/
$.fn.dataTableSettings = [];
var _aoSettings = $.fn.dataTableSettings; /* Short reference for fast internal lookup */
/*
* Variable: dataTableExt
* Purpose: Container for customisable parts of DataTables
* Scope: jQuery.fn
*/
$.fn.dataTableExt = {};
var _oExt = $.fn.dataTableExt;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Section - DataTables extensible objects
*
* The _oExt object is used to provide an area where user dfined plugins can be
* added to DataTables. The following properties of the object are used:
* oApi - Plug-in API functions
* aTypes - Auto-detection of types
* oSort - Sorting functions used by DataTables (based on the type)
* oPagination - Pagination functions for different input styles
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Variable: sVersion
* Purpose: Version string for plug-ins to check compatibility
* Scope: jQuery.fn.dataTableExt
* Notes: Allowed format is a.b.c.d.e where:
* a:int, b:int, c:int, d:string(dev|beta), e:int. d and e are optional
*/
_oExt.sVersion = "1.7.5";
/*
* Variable: sErrMode
* Purpose: How should DataTables report an error. Can take the value 'alert' or 'throw'
* Scope: jQuery.fn.dataTableExt
*/
_oExt.sErrMode = "alert";
/*
* Variable: iApiIndex
* Purpose: Index for what 'this' index API functions should use
* Scope: jQuery.fn.dataTableExt
*/
_oExt.iApiIndex = 0;
/*
* Variable: oApi
* Purpose: Container for plugin API functions
* Scope: jQuery.fn.dataTableExt
*/
_oExt.oApi = { };
/*
* Variable: aFiltering
* Purpose: Container for plugin filtering functions
* Scope: jQuery.fn.dataTableExt
*/
_oExt.afnFiltering = [ ];
/*
* Variable: aoFeatures
* Purpose: Container for plugin function functions
* Scope: jQuery.fn.dataTableExt
* Notes: Array of objects with the following parameters:
* fnInit: Function for initialisation of Feature. Takes oSettings and returns node
* cFeature: Character that will be matched in sDom - case sensitive
* sFeature: Feature name - just for completeness :-)
*/
_oExt.aoFeatures = [ ];
/*
* Variable: ofnSearch
* Purpose: Container for custom filtering functions
* Scope: jQuery.fn.dataTableExt
* Notes: This is an object (the name should match the type) for custom filtering function,
* which can be used for live DOM checking or formatted text filtering
*/
_oExt.ofnSearch = { };
/*
* Variable: afnSortData
* Purpose: Container for custom sorting data source functions
* Scope: jQuery.fn.dataTableExt
* Notes: Array (associative) of functions which is run prior to a column of this
* 'SortDataType' being sorted upon.
* Function input parameters:
* object:oSettings- DataTables settings object
* int:iColumn - Target column number
* Return value: Array of data which exactly matched the full data set size for the column to
* be sorted upon
*/
_oExt.afnSortData = [ ];
/*
* Variable: oStdClasses
* Purpose: Storage for the various classes that DataTables uses
* Scope: jQuery.fn.dataTableExt
*/
_oExt.oStdClasses = {
/* Two buttons buttons */
"sPagePrevEnabled": "paginate_enabled_previous",
"sPagePrevDisabled": "paginate_disabled_previous",
"sPageNextEnabled": "paginate_enabled_next",
"sPageNextDisabled": "paginate_disabled_next",
"sPageJUINext": "",
"sPageJUIPrev": "",
/* Full numbers paging buttons */
"sPageButton": "paginate_button",
"sPageButtonActive": "paginate_active",
"sPageButtonStaticDisabled": "paginate_button",
"sPageFirst": "first",
"sPagePrevious": "previous",
"sPageNext": "next",
"sPageLast": "last",
/* Stripping classes */
"sStripOdd": "odd",
"sStripEven": "even",
/* Empty row */
"sRowEmpty": "dataTables_empty",
/* Features */
"sWrapper": "dataTables_wrapper",
"sFilter": "dataTables_filter",
"sInfo": "dataTables_info",
"sPaging": "dataTables_paginate paging_", /* Note that the type is postfixed */
"sLength": "dataTables_length",
"sProcessing": "dataTables_processing",
/* Sorting */
"sSortAsc": "sorting_asc",
"sSortDesc": "sorting_desc",
"sSortable": "sorting", /* Sortable in both directions */
"sSortableAsc": "sorting_asc_disabled",
"sSortableDesc": "sorting_desc_disabled",
"sSortableNone": "sorting_disabled",
"sSortColumn": "sorting_", /* Note that an int is postfixed for the sorting order */
"sSortJUIAsc": "",
"sSortJUIDesc": "",
"sSortJUI": "",
"sSortJUIAscAllowed": "",
"sSortJUIDescAllowed": "",
"sSortJUIWrapper": "",
/* Scrolling */
"sScrollWrapper": "dataTables_scroll",
"sScrollHead": "dataTables_scrollHead",
"sScrollHeadInner": "dataTables_scrollHeadInner",
"sScrollBody": "dataTables_scrollBody",
"sScrollFoot": "dataTables_scrollFoot",
"sScrollFootInner": "dataTables_scrollFootInner",
/* Misc */
"sFooterTH": ""
};
/*
* Variable: oJUIClasses
* Purpose: Storage for the various classes that DataTables uses - jQuery UI suitable
* Scope: jQuery.fn.dataTableExt
*/
_oExt.oJUIClasses = {
/* Two buttons buttons */
"sPagePrevEnabled": "fg-button ui-button ui-state-default ui-corner-left",
"sPagePrevDisabled": "fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",
"sPageNextEnabled": "fg-button ui-button ui-state-default ui-corner-right",
"sPageNextDisabled": "fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",
"sPageJUINext": "ui-icon ui-icon-circle-arrow-e",
"sPageJUIPrev": "ui-icon ui-icon-circle-arrow-w",
/* Full numbers paging buttons */
"sPageButton": "fg-button ui-button ui-state-default",
"sPageButtonActive": "fg-button ui-button ui-state-default ui-state-disabled",
"sPageButtonStaticDisabled": "fg-button ui-button ui-state-default ui-state-disabled",
"sPageFirst": "first ui-corner-tl ui-corner-bl",
"sPagePrevious": "previous",
"sPageNext": "next",
"sPageLast": "last ui-corner-tr ui-corner-br",
/* Stripping classes */
"sStripOdd": "odd",
"sStripEven": "even",
/* Empty row */
"sRowEmpty": "dataTables_empty",
/* Features */
"sWrapper": "dataTables_wrapper",
"sFilter": "dataTables_filter",
"sInfo": "dataTables_info",
"sPaging": "dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi "+
"ui-buttonset-multi paging_", /* Note that the type is postfixed */
"sLength": "dataTables_length",
"sProcessing": "dataTables_processing",
/* Sorting */
"sSortAsc": "ui-state-default",
"sSortDesc": "ui-state-default",
"sSortable": "ui-state-default",
"sSortableAsc": "ui-state-default",
"sSortableDesc": "ui-state-default",
"sSortableNone": "ui-state-default",
"sSortColumn": "sorting_", /* Note that an int is postfixed for the sorting order */
"sSortJUIAsc": "css_right ui-icon ui-icon-triangle-1-n",
"sSortJUIDesc": "css_right ui-icon ui-icon-triangle-1-s",
"sSortJUI": "css_right ui-icon ui-icon-carat-2-n-s",
"sSortJUIAscAllowed": "css_right ui-icon ui-icon-carat-1-n",
"sSortJUIDescAllowed": "css_right ui-icon ui-icon-carat-1-s",
"sSortJUIWrapper": "DataTables_sort_wrapper",
/* Scrolling */
"sScrollWrapper": "dataTables_scroll",
"sScrollHead": "dataTables_scrollHead ui-state-default",
"sScrollHeadInner": "dataTables_scrollHeadInner",
"sScrollBody": "dataTables_scrollBody",
"sScrollFoot": "dataTables_scrollFoot ui-state-default",
"sScrollFootInner": "dataTables_scrollFootInner",
/* Misc */
"sFooterTH": "ui-state-default"
};
/*
* Variable: oPagination
* Purpose: Container for the various type of pagination that dataTables supports
* Scope: jQuery.fn.dataTableExt
*/
_oExt.oPagination = {
/*
* Variable: two_button
* Purpose: Standard two button (forward/back) pagination
* Scope: jQuery.fn.dataTableExt.oPagination
*/
"two_button": {
/*
* Function: oPagination.two_button.fnInit
* Purpose: Initalise dom elements required for pagination with forward/back buttons only
* Returns: -
* Inputs: object:oSettings - dataTables settings object
* node:nPaging - the DIV which contains this pagination control
* function:fnCallbackDraw - draw function which must be called on update
*/
"fnInit": function ( oSettings, nPaging, fnCallbackDraw )
{
var nPrevious, nNext, nPreviousInner, nNextInner;
/* Store the next and previous elements in the oSettings object as they can be very
* usful for automation - particularly testing
*/
if ( !oSettings.bJUI )
{
nPrevious = document.createElement( 'div' );
nNext = document.createElement( 'div' );
}
else
{
nPrevious = document.createElement( 'a' );
nNext = document.createElement( 'a' );
nNextInner = document.createElement('span');
nNextInner.className = oSettings.oClasses.sPageJUINext;
nNext.appendChild( nNextInner );
nPreviousInner = document.createElement('span');
nPreviousInner.className = oSettings.oClasses.sPageJUIPrev;
nPrevious.appendChild( nPreviousInner );
}
nPrevious.className = oSettings.oClasses.sPagePrevDisabled;
nNext.className = oSettings.oClasses.sPageNextDisabled;
nPrevious.title = oSettings.oLanguage.oPaginate.sPrevious;
nNext.title = oSettings.oLanguage.oPaginate.sNext;
nPaging.appendChild( nPrevious );
nPaging.appendChild( nNext );
$(nPrevious).click( function() {
if ( oSettings.oApi._fnPageChange( oSettings, "previous" ) )
{
/* Only draw when the page has actually changed */
fnCallbackDraw( oSettings );
}
} );
$(nNext).click( function() {
if ( oSettings.oApi._fnPageChange( oSettings, "next" ) )
{
fnCallbackDraw( oSettings );
}
} );
/* Take the brutal approach to cancelling text selection */
$(nPrevious).bind( 'selectstart', function () { return false; } );
$(nNext).bind( 'selectstart', function () { return false; } );
/* ID the first elements only */
if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.p == "undefined" )
{
nPaging.setAttribute( 'id', oSettings.sTableId+'_paginate' );
nPrevious.setAttribute( 'id', oSettings.sTableId+'_previous' );
nNext.setAttribute( 'id', oSettings.sTableId+'_next' );
}
},
/*
* Function: oPagination.two_button.fnUpdate
* Purpose: Update the two button pagination at the end of the draw
* Returns: -
* Inputs: object:oSettings - dataTables settings object
* function:fnCallbackDraw - draw function to call on page change
*/
"fnUpdate": function ( oSettings, fnCallbackDraw )
{
if ( !oSettings.aanFeatures.p )
{
return;
}
/* Loop over each instance of the pager */
var an = oSettings.aanFeatures.p;
for ( var i=0, iLen=an.length ; i= (iPages - iPageCountHalf))
{
iStartButton = iPages - iPageCount + 1;
iEndButton = iPages;
}
else
{
iStartButton = iCurrentPage - Math.ceil(iPageCount / 2) + 1;
iEndButton = iStartButton + iPageCount - 1;
}
}
}
/* Build the dynamic list */
for ( i=iStartButton ; i<=iEndButton ; i++ )
{
if ( iCurrentPage != i )
{
sList += ''+i+'';
}
else
{
sList += ''+i+'';
}
}
/* Loop over each instance of the pager */
var an = oSettings.aanFeatures.p;
var anButtons, anStatic, nPaginateList;
var fnClick = function() {
/* Use the information in the element to jump to the required page */
var iTarget = (this.innerHTML * 1) - 1;
oSettings._iDisplayStart = iTarget * oSettings._iDisplayLength;
fnCallbackDraw( oSettings );
return false;
};
var fnFalse = function () { return false; };
for ( i=0, iLen=an.length ; i y) ? 1 : 0));
},
"string-desc": function ( a, b )
{
var x = a.toLowerCase();
var y = b.toLowerCase();
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
},
/*
* html sorting (ignore html tags)
*/
"html-asc": function ( a, b )
{
var x = a.replace( /<.*?>/g, "" ).toLowerCase();
var y = b.replace( /<.*?>/g, "" ).toLowerCase();
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
},
"html-desc": function ( a, b )
{
var x = a.replace( /<.*?>/g, "" ).toLowerCase();
var y = b.replace( /<.*?>/g, "" ).toLowerCase();
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
},
/*
* date sorting
*/
"date-asc": function ( a, b )
{
var x = Date.parse( a );
var y = Date.parse( b );
if ( isNaN(x) || x==="" )
{
x = Date.parse( "01/01/1970 00:00:00" );
}
if ( isNaN(y) || y==="" )
{
y = Date.parse( "01/01/1970 00:00:00" );
}
return x - y;
},
"date-desc": function ( a, b )
{
var x = Date.parse( a );
var y = Date.parse( b );
if ( isNaN(x) || x==="" )
{
x = Date.parse( "01/01/1970 00:00:00" );
}
if ( isNaN(y) || y==="" )
{
y = Date.parse( "01/01/1970 00:00:00" );
}
return y - x;
},
/*
* numerical sorting
*/
"numeric-asc": function ( a, b )
{
var x = (a=="-" || a==="") ? 0 : a*1;
var y = (b=="-" || b==="") ? 0 : b*1;
return x - y;
},
"numeric-desc": function ( a, b )
{
var x = (a=="-" || a==="") ? 0 : a*1;
var y = (b=="-" || b==="") ? 0 : b*1;
return y - x;
}
};
/*
* Variable: aTypes
* Purpose: Container for the various type of type detection that dataTables supports
* Scope: jQuery.fn.dataTableExt
* Notes: The functions in this array are expected to parse a string to see if it is a data
* type that it recognises. If so then the function should return the name of the type (a
* corresponding sort function should be defined!), if the type is not recognised then the
* function should return null such that the parser and move on to check the next type.
* Note that ordering is important in this array - the functions are processed linearly,
* starting at index 0.
* Note that the input for these functions is always a string! It cannot be any other data
* type
*/
_oExt.aTypes = [
/*
* Function: -
* Purpose: Check to see if a string is numeric
* Returns: string:'numeric' or null
* Inputs: string:sText - string to check
*/
function ( sData )
{
/* Allow zero length strings as a number */
if ( sData.length === 0 )
{
return 'numeric';
}
var sValidFirstChars = "0123456789-";
var sValidChars = "0123456789.";
var Char;
var bDecimal = false;
/* Check for a valid first char (no period and allow negatives) */
Char = sData.charAt(0);
if (sValidFirstChars.indexOf(Char) == -1)
{
return null;
}
/* Check all the other characters are valid */
for ( var i=1 ; i') != -1 )
{
return 'html';
}
return null;
}
];
/*
* Function: fnVersionCheck
* Purpose: Check a version string against this version of DataTables. Useful for plug-ins
* Returns: bool:true -this version of DataTables is greater or equal to the required version
* false -this version of DataTales is not suitable
* Inputs: string:sVersion - the version to check against. May be in the following formats:
* "a", "a.b" or "a.b.c"
* Notes: This function will only check the first three parts of a version string. It is
* assumed that beta and dev versions will meet the requirements. This might change in future
*/
_oExt.fnVersionCheck = function( sVersion )
{
/* This is cheap, but very effective */
var fnZPad = function (Zpad, count)
{
while(Zpad.length < count) {
Zpad += '0';
}
return Zpad;
};
var aThis = _oExt.sVersion.split('.');
var aThat = sVersion.split('.');
var sThis = '', sThat = '';
for ( var i=0, iLen=aThat.length ; i= parseInt(sThat, 10);
};
/*
* Variable: _oExternConfig
* Purpose: Store information for DataTables to access globally about other instances
* Scope: jQuery.fn.dataTableExt
*/
_oExt._oExternConfig = {
/* int:iNextUnique - next unique number for an instance */
"iNextUnique": 0
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Section - DataTables prototype
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Function: dataTable
* Purpose: DataTables information
* Returns: -
* Inputs: object:oInit - initalisation options for the table
*/
$.fn.dataTable = function( oInit )
{
/*
* Function: classSettings
* Purpose: Settings container function for all 'class' properties which are required
* by dataTables
* Returns: -
* Inputs: -
*/
function classSettings ()
{
this.fnRecordsTotal = function ()
{
if ( this.oFeatures.bServerSide ) {
return parseInt(this._iRecordsTotal, 10);
} else {
return this.aiDisplayMaster.length;
}
};
this.fnRecordsDisplay = function ()
{
if ( this.oFeatures.bServerSide ) {
return parseInt(this._iRecordsDisplay, 10);
} else {
return this.aiDisplay.length;
}
};
this.fnDisplayEnd = function ()
{
if ( this.oFeatures.bServerSide ) {
if ( this.oFeatures.bPaginate === false || this._iDisplayLength == -1 ) {
return this._iDisplayStart+this.aiDisplay.length;
} else {
return Math.min( this._iDisplayStart+this._iDisplayLength,
this._iRecordsDisplay );
}
} else {
return this._iDisplayEnd;
}
};
/*
* Variable: oInstance
* Purpose: The DataTables object for this table
* Scope: jQuery.dataTable.classSettings
*/
this.oInstance = null;
/*
* Variable: sInstance
* Purpose: Unique idendifier for each instance of the DataTables object
* Scope: jQuery.dataTable.classSettings
*/
this.sInstance = null;
/*
* Variable: oFeatures
* Purpose: Indicate the enablement of key dataTable features
* Scope: jQuery.dataTable.classSettings
*/
this.oFeatures = {
"bPaginate": true,
"bLengthChange": true,
"bFilter": true,
"bSort": true,
"bInfo": true,
"bAutoWidth": true,
"bProcessing": false,
"bSortClasses": true,
"bStateSave": false,
"bServerSide": false
};
/*
* Variable: oScroll
* Purpose: Container for scrolling options
* Scope: jQuery.dataTable.classSettings
*/
this.oScroll = {
"sX": "",
"sXInner": "",
"sY": "",
"bCollapse": false,
"bInfinite": false,
"iLoadGap": 100,
"iBarWidth": 0,
"bAutoCss": true
};
/*
* Variable: aanFeatures
* Purpose: Array referencing the nodes which are used for the features
* Scope: jQuery.dataTable.classSettings
* Notes: The parameters of this object match what is allowed by sDom - i.e.
* 'l' - Length changing
* 'f' - Filtering input
* 't' - The table!
* 'i' - Information
* 'p' - Pagination
* 'r' - pRocessing
*/
this.aanFeatures = [];
/*
* Variable: oLanguage
* Purpose: Store the language strings used by dataTables
* Scope: jQuery.dataTable.classSettings
* Notes: The words in the format _VAR_ are variables which are dynamically replaced
* by javascript
*/
this.oLanguage = {
"sProcessing": "Processing...",
"sLengthMenu": "Show _MENU_ entries",
"sZeroRecords": "No matching records found",
"sEmptyTable": "No data available in table",
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
"sInfoEmpty": "Showing 0 to 0 of 0 entries",
"sInfoFiltered": "(filtered from _MAX_ total entries)",
"sInfoPostFix": "",
"sSearch": "Search:",
"sUrl": "",
"oPaginate": {
"sFirst": "First",
"sPrevious": "Previous",
"sNext": "Next",
"sLast": "Last"
},
"fnInfoCallback": null
};
/*
* Variable: aoData
* Purpose: Store data information
* Scope: jQuery.dataTable.classSettings
* Notes: This is an array of objects with the following parameters:
* int: _iId - internal id for tracking
* array: _aData - internal data - used for sorting / filtering etc
* node: nTr - display node
* array node: _anHidden - hidden TD nodes
* string: _sRowStripe
*/
this.aoData = [];
/*
* Variable: aiDisplay
* Purpose: Array of indexes which are in the current display (after filtering etc)
* Scope: jQuery.dataTable.classSettings
*/
this.aiDisplay = [];
/*
* Variable: aiDisplayMaster
* Purpose: Array of indexes for display - no filtering
* Scope: jQuery.dataTable.classSettings
*/
this.aiDisplayMaster = [];
/*
* Variable: aoColumns
* Purpose: Store information about each column that is in use
* Scope: jQuery.dataTable.classSettings
*/
this.aoColumns = [];
/*
* Variable: iNextId
* Purpose: Store the next unique id to be used for a new row
* Scope: jQuery.dataTable.classSettings
*/
this.iNextId = 0;
/*
* Variable: asDataSearch
* Purpose: Search data array for regular expression searching
* Scope: jQuery.dataTable.classSettings
*/
this.asDataSearch = [];
/*
* Variable: oPreviousSearch
* Purpose: Store the previous search incase we want to force a re-search
* or compare the old search to a new one
* Scope: jQuery.dataTable.classSettings
*/
this.oPreviousSearch = {
"sSearch": "",
"bRegex": false,
"bSmart": true
};
/*
* Variable: aoPreSearchCols
* Purpose: Store the previous search for each column
* Scope: jQuery.dataTable.classSettings
*/
this.aoPreSearchCols = [];
/*
* Variable: aaSorting
* Purpose: Sorting information
* Scope: jQuery.dataTable.classSettings
* Notes: Index 0 - column number
* Index 1 - current sorting direction
* Index 2 - index of asSorting for this column
*/
this.aaSorting = [ [0, 'asc', 0] ];
/*
* Variable: aaSortingFixed
* Purpose: Sorting information that is always applied
* Scope: jQuery.dataTable.classSettings
*/
this.aaSortingFixed = null;
/*
* Variable: asStripClasses
* Purpose: Classes to use for the striping of a table
* Scope: jQuery.dataTable.classSettings
*/
this.asStripClasses = [];
/*
* Variable: asDestoryStrips
* Purpose: If restoring a table - we should restore it's striping classes as well
* Scope: jQuery.dataTable.classSettings
*/
this.asDestoryStrips = [];
/*
* Variable: sDestroyWidth
* Purpose: If restoring a table - we should restore it's width
* Scope: jQuery.dataTable.classSettings
*/
this.sDestroyWidth = 0;
/*
* Variable: fnRowCallback
* Purpose: Call this function every time a row is inserted (draw)
* Scope: jQuery.dataTable.classSettings
*/
this.fnRowCallback = null;
/*
* Variable: fnHeaderCallback
* Purpose: Callback function for the header on each draw
* Scope: jQuery.dataTable.classSettings
*/
this.fnHeaderCallback = null;
/*
* Variable: fnFooterCallback
* Purpose: Callback function for the footer on each draw
* Scope: jQuery.dataTable.classSettings
*/
this.fnFooterCallback = null;
/*
* Variable: aoDrawCallback
* Purpose: Array of callback functions for draw callback functions
* Scope: jQuery.dataTable.classSettings
* Notes: Each array element is an object with the following parameters:
* function:fn - function to call
* string:sName - name callback (feature). useful for arranging array
*/
this.aoDrawCallback = [];
/*
* Variable: fnInitComplete
* Purpose: Callback function for when the table has been initalised
* Scope: jQuery.dataTable.classSettings
*/
this.fnInitComplete = null;
/*
* Variable: sTableId
* Purpose: Cache the table ID for quick access
* Scope: jQuery.dataTable.classSettings
*/
this.sTableId = "";
/*
* Variable: nTable
* Purpose: Cache the table node for quick access
* Scope: jQuery.dataTable.classSettings
*/
this.nTable = null;
/*
* Variable: nTHead
* Purpose: Permanent ref to the thead element
* Scope: jQuery.dataTable.classSettings
*/
this.nTHead = null;
/*
* Variable: nTFoot
* Purpose: Permanent ref to the tfoot element - if it exists
* Scope: jQuery.dataTable.classSettings
*/
this.nTFoot = null;
/*
* Variable: nTBody
* Purpose: Permanent ref to the tbody element
* Scope: jQuery.dataTable.classSettings
*/
this.nTBody = null;
/*
* Variable: nTableWrapper
* Purpose: Cache the wrapper node (contains all DataTables controlled elements)
* Scope: jQuery.dataTable.classSettings
*/
this.nTableWrapper = null;
/*
* Variable: bInitialised
* Purpose: Indicate if all required information has been read in
* Scope: jQuery.dataTable.classSettings
*/
this.bInitialised = false;
/*
* Variable: aoOpenRows
* Purpose: Information about open rows
* Scope: jQuery.dataTable.classSettings
* Notes: Has the parameters 'nTr' and 'nParent'
*/
this.aoOpenRows = [];
/*
* Variable: sDom
* Purpose: Dictate the positioning that the created elements will take
* Scope: jQuery.dataTable.classSettings
* Notes:
* The following options are allowed:
* 'l' - Length changing
* 'f' - Filtering input
* 't' - The table!
* 'i' - Information
* 'p' - Pagination
* 'r' - pRocessing
* The following constants are allowed:
* 'H' - jQueryUI theme "header" classes
* 'F' - jQueryUI theme "footer" classes
* The following syntax is expected:
* '<' and '>' - div elements
* '<"class" and '>' - div with a class
* Examples:
* '<"wrapper"flipt>', 'ip>'
*/
this.sDom = 'lfrtip';
/*
* Variable: sPaginationType
* Purpose: Note which type of sorting should be used
* Scope: jQuery.dataTable.classSettings
*/
this.sPaginationType = "two_button";
/*
* Variable: iCookieDuration
* Purpose: The cookie duration (for bStateSave) in seconds - default 2 hours
* Scope: jQuery.dataTable.classSettings
*/
this.iCookieDuration = 60 * 60 * 2;
/*
* Variable: sCookiePrefix
* Purpose: The cookie name prefix
* Scope: jQuery.dataTable.classSettings
*/
this.sCookiePrefix = "SpryMedia_DataTables_";
/*
* Variable: fnCookieCallback
* Purpose: Callback function for cookie creation
* Scope: jQuery.dataTable.classSettings
*/
this.fnCookieCallback = null;
/*
* Variable: aoStateSave
* Purpose: Array of callback functions for state saving
* Scope: jQuery.dataTable.classSettings
* Notes: Each array element is an object with the following parameters:
* function:fn - function to call. Takes two parameters, oSettings and the JSON string to
* save that has been thus far created. Returns a JSON string to be inserted into a
* json object (i.e. '"param": [ 0, 1, 2]')
* string:sName - name of callback
*/
this.aoStateSave = [];
/*
* Variable: aoStateLoad
* Purpose: Array of callback functions for state loading
* Scope: jQuery.dataTable.classSettings
* Notes: Each array element is an object with the following parameters:
* function:fn - function to call. Takes two parameters, oSettings and the object stored.
* May return false to cancel state loading.
* string:sName - name of callback
*/
this.aoStateLoad = [];
/*
* Variable: oLoadedState
* Purpose: State that was loaded from the cookie. Useful for back reference
* Scope: jQuery.dataTable.classSettings
*/
this.oLoadedState = null;
/*
* Variable: sAjaxSource
* Purpose: Source url for AJAX data for the table
* Scope: jQuery.dataTable.classSettings
*/
this.sAjaxSource = null;
/*
* Variable: bAjaxDataGet
* Purpose: Note if draw should be blocked while getting data
* Scope: jQuery.dataTable.classSettings
*/
this.bAjaxDataGet = true;
/*
* Variable: fnServerData
* Purpose: Function to get the server-side data - can be overruled by the developer
* Scope: jQuery.dataTable.classSettings
*/
this.fnServerData = function ( url, data, callback ) {
$.ajax( {
"url": url,
"data": data,
"success": callback,
"dataType": "json",
"cache": false,
"error": function (xhr, error, thrown) {
if ( error == "parsererror" ) {
alert( "DataTables warning: JSON data from server could not be parsed. "+
"This is caused by a JSON formatting error." );
}
}
} );
};
/*
* Variable: fnFormatNumber
* Purpose: Format numbers for display
* Scope: jQuery.dataTable.classSettings
*/
this.fnFormatNumber = function ( iIn )
{
if ( iIn < 1000 )
{
/* A small optimisation for what is likely to be the vast majority of use cases */
return iIn;
}
else
{
var s=(iIn+""), a=s.split(""), out="", iLen=s.length;
for ( var i=0 ; i= oSettings.aiDisplay.length )
{
oSettings._iDisplayStart -= oSettings._iDisplayLength;
if ( oSettings._iDisplayStart < 0 )
{
oSettings._iDisplayStart = 0;
}
}
if ( typeof bRedraw == 'undefined' || bRedraw )
{
_fnCalculateEnd( oSettings );
_fnDraw( oSettings );
}
return oData;
};
/*
* Function: fnClearTable
* Purpose: Quickly and simply clear a table
* Returns: -
* Inputs: bool:bRedraw - redraw the table or not - default true
* Notes: Thanks to Yekimov Denis for contributing the basis for this function!
*/
this.fnClearTable = function( bRedraw )
{
/* Find settings from table node */
var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
_fnClearTable( oSettings );
if ( typeof bRedraw == 'undefined' || bRedraw )
{
_fnDraw( oSettings );
}
};
/*
* Function: fnOpen
* Purpose: Open a display row (append a row after the row in question)
* Returns: node:nNewRow - the row opened
* Inputs: node:nTr - the table row to 'open'
* string:sHtml - the HTML to put into the row
* string:sClass - class to give the new TD cell
*/
this.fnOpen = function( nTr, sHtml, sClass )
{
/* Find settings from table node */
var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
/* the old open one if there is one */
this.fnClose( nTr );
var nNewRow = document.createElement("tr");
var nNewCell = document.createElement("td");
nNewRow.appendChild( nNewCell );
nNewCell.className = sClass;
nNewCell.colSpan = _fnVisbleColumns( oSettings );
nNewCell.innerHTML = sHtml;
/* If the nTr isn't on the page at the moment - then we don't insert at the moment */
var nTrs = $('tr', oSettings.nTBody);
if ( $.inArray(nTr, nTrs) != -1 )
{
$(nNewRow).insertAfter(nTr);
}
oSettings.aoOpenRows.push( {
"nTr": nNewRow,
"nParent": nTr
} );
return nNewRow;
};
/*
* Function: fnClose
* Purpose: Close a display row
* Returns: int: 0 (success) or 1 (failed)
* Inputs: node:nTr - the table row to 'close'
*/
this.fnClose = function( nTr )
{
/* Find settings from table node */
var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
for ( var i=0 ; itr', oSettings.nTHead)[0];
var nTrFoot = $('>tr', oSettings.nTFoot)[0];
var anTheadTh = [];
var anTfootTh = [];
for ( i=0 ; i= _fnVisbleColumns( oSettings ) )
{
nTrHead.appendChild( anTheadTh[iCol] );
anTrs = $('>tr', oSettings.nTHead);
for ( i=1, iLen=anTrs.length ; itr', oSettings.nTFoot);
for ( i=1, iLen=anTrs.length ; itr', oSettings.nTHead);
for ( i=1, iLen=anTrs.length ; itr', oSettings.nTFoot);
for ( i=1, iLen=anTrs.length ; itd:eq('+iBefore+')',
oSettings.aoData[i].nTr)[0] );
}
}
oSettings.aoColumns[iCol].bVisible = true;
}
else
{
/* Remove a column from display */
nTrHead.removeChild( anTheadTh[iCol] );
for ( i=0, iLen=oSettings.aoColumns[iCol].anThExtra.length ; itr>td.'+oSettings.oClasses.sRowEmpty, oSettings.nTable).parent().remove();
/* When scrolling we had to break the table up - restore it */
if ( oSettings.nTable != oSettings.nTHead.parentNode )
{
$('>thead', oSettings.nTable).remove();
oSettings.nTable.appendChild( oSettings.nTHead );
}
if ( oSettings.nTFoot && oSettings.nTable != oSettings.nTFoot.parentNode )
{
$('>tfoot', oSettings.nTable).remove();
oSettings.nTable.appendChild( oSettings.nTFoot );
}
/* Remove the DataTables generated nodes, events and classes */
oSettings.nTable.parentNode.removeChild( oSettings.nTable );
$(oSettings.nTableWrapper).remove();
oSettings.aaSorting = [];
oSettings.aaSortingFixed = [];
_fnSortingClasses( oSettings );
$(_fnGetTrNodes( oSettings )).removeClass( oSettings.asStripClasses.join(' ') );
if ( !oSettings.bJUI )
{
$('th', oSettings.nTHead).removeClass( [ _oExt.oStdClasses.sSortable,
_oExt.oStdClasses.sSortableAsc,
_oExt.oStdClasses.sSortableDesc,
_oExt.oStdClasses.sSortableNone ].join(' ')
);
}
else
{
$('th', oSettings.nTHead).removeClass( [ _oExt.oStdClasses.sSortable,
_oExt.oJUIClasses.sSortableAsc,
_oExt.oJUIClasses.sSortableDesc,
_oExt.oJUIClasses.sSortableNone ].join(' ')
);
$('th span', oSettings.nTHead).remove();
}
/* Add the TR elements back into the table in their original order */
nOrig.appendChild( oSettings.nTable );
for ( i=0, iLen=oSettings.aoData.length ; itr:even', nBody).addClass( oSettings.asDestoryStrips[0] );
$('>tr:odd', nBody).addClass( oSettings.asDestoryStrips[1] );
/* Remove the settings object from the settings array */
for ( i=0, iLen=_aoSettings.length ; i=0 if successful (index of new aoData entry), -1 if failed
* Inputs: object:oSettings - dataTables settings object
* array:aData - data array to be added
* Notes: There are two basic methods for DataTables to get data to display - a JS array
* (which is dealt with by this function), and the DOM, which has it's own optimised
* function (_fnGatherData). Be careful to make the same changes here as there and vice-versa
*/
function _fnAddData ( oSettings, aDataSupplied )
{
/* Sanity check the length of the new array */
if ( aDataSupplied.length != oSettings.aoColumns.length &&
oSettings.iDrawError != oSettings.iDraw )
{
_fnLog( oSettings, 0, "Added data (size "+aDataSupplied.length+") does not match known "+
"number of columns ("+oSettings.aoColumns.length+")" );
oSettings.iDrawError = oSettings.iDraw;
return -1;
}
/* Create the object for storing information about this new row */
var aData = aDataSupplied.slice();
var iThisIndex = oSettings.aoData.length;
oSettings.aoData.push( {
"nTr": document.createElement('tr'),
"_iId": oSettings.iNextId++,
"_aData": aData,
"_anHidden": [],
"_sRowStripe": ''
} );
/* Create the cells */
var nTd, sThisType;
for ( var i=0 ; i= oSettings.fnRecordsDisplay()) ?
0 : oSettings.iInitDisplayStart;
}
oSettings.iInitDisplayStart = -1;
_fnCalculateEnd( oSettings );
}
/* If we are dealing with Ajax - do it here */
if ( !oSettings.bDestroying && oSettings.oFeatures.bServerSide &&
!_fnAjaxUpdate( oSettings ) )
{
return;
}
else if ( !oSettings.oFeatures.bServerSide )
{
oSettings.iDraw++;
}
if ( oSettings.aiDisplay.length !== 0 )
{
var iStart = oSettings._iDisplayStart;
var iEnd = oSettings._iDisplayEnd;
if ( oSettings.oFeatures.bServerSide )
{
iStart = 0;
iEnd = oSettings.aoData.length;
}
for ( var j=iStart ; jtr', oSettings.nTHead)[0],
_fnGetDataMaster( oSettings ), oSettings._iDisplayStart, oSettings.fnDisplayEnd(),
oSettings.aiDisplay );
}
if ( typeof oSettings.fnFooterCallback == 'function' )
{
oSettings.fnFooterCallback.call( oSettings.oInstance, $('>tr', oSettings.nTFoot)[0],
_fnGetDataMaster( oSettings ), oSettings._iDisplayStart, oSettings.fnDisplayEnd(),
oSettings.aiDisplay );
}
/*
* Need to remove any old row from the display - note we can't just empty the tbody using
* $().html('') since this will unbind the jQuery event handlers (even although the node
* still exists!) - equally we can't use innerHTML, since IE throws an exception.
*/
var
nAddFrag = document.createDocumentFragment(),
nRemoveFrag = document.createDocumentFragment(),
nBodyPar, nTrs;
if ( oSettings.nTBody )
{
nBodyPar = oSettings.nTBody.parentNode;
nRemoveFrag.appendChild( oSettings.nTBody );
/* When doing infinite scrolling, only remove child rows when sorting, filtering or start
* up. When not infinite scroll, always do it.
*/
if ( !oSettings.oScroll.bInfinite || !oSettings._bInitComplete ||
oSettings.bSorted || oSettings.bFiltered )
{
nTrs = oSettings.nTBody.childNodes;
for ( i=nTrs.length-1 ; i>=0 ; i-- )
{
nTrs[i].parentNode.removeChild( nTrs[i] );
}
}
/* Put the draw table into the dom */
for ( i=0, iLen=anRows.length ; i=0 ; i-- )
{
oSettings.aoDrawCallback[i].fn.call( oSettings.oInstance, oSettings );
}
/* Draw is complete, sorting and filtering must be as well */
oSettings.bSorted = false;
oSettings.bFiltered = false;
oSettings.bDrawing = false;
if ( oSettings.oFeatures.bServerSide )
{
_fnProcessingDisplay( oSettings, false );
if ( typeof oSettings._bInitComplete == 'undefined' )
{
_fnInitComplete( oSettings );
}
}
}
/*
* Function: _fnReDraw
* Purpose: Redraw the table - taking account of the various features which are enabled
* Returns: -
* Inputs: object:oSettings - dataTables settings object
*/
function _fnReDraw( oSettings )
{
if ( oSettings.oFeatures.bSort )
{
/* Sorting will refilter and draw for us */
_fnSort( oSettings, oSettings.oPreviousSearch );
}
else if ( oSettings.oFeatures.bFilter )
{
/* Filtering will redraw for us */
_fnFilterComplete( oSettings, oSettings.oPreviousSearch );
}
else
{
_fnCalculateEnd( oSettings );
_fnDraw( oSettings );
}
}
/*
* Function: _fnAjaxUpdate
* Purpose: Update the table using an Ajax call
* Returns: bool: block the table drawing or not
* Inputs: object:oSettings - dataTables settings object
*/
function _fnAjaxUpdate( oSettings )
{
if ( oSettings.bAjaxDataGet )
{
_fnProcessingDisplay( oSettings, true );
var iColumns = oSettings.aoColumns.length;
var aoData = [];
var i;
/* Paging and general */
oSettings.iDraw++;
aoData.push( { "name": "sEcho", "value": oSettings.iDraw } );
aoData.push( { "name": "iColumns", "value": iColumns } );
aoData.push( { "name": "sColumns", "value": _fnColumnOrdering(oSettings) } );
aoData.push( { "name": "iDisplayStart", "value": oSettings._iDisplayStart } );
aoData.push( { "name": "iDisplayLength", "value": oSettings.oFeatures.bPaginate !== false ?
oSettings._iDisplayLength : -1 } );
/* Filtering */
if ( oSettings.oFeatures.bFilter !== false )
{
aoData.push( { "name": "sSearch", "value": oSettings.oPreviousSearch.sSearch } );
aoData.push( { "name": "bRegex", "value": oSettings.oPreviousSearch.bRegex } );
for ( i=0 ; i' )
{
/* End container div */
nInsertNode = nInsertNode.parentNode;
}
else if ( cOption == 'l' && oSettings.oFeatures.bPaginate && oSettings.oFeatures.bLengthChange )
{
/* Length */
nTmp = _fnFeatureHtmlLength( oSettings );
iPushFeature = 1;
}
else if ( cOption == 'f' && oSettings.oFeatures.bFilter )
{
/* Filter */
nTmp = _fnFeatureHtmlFilter( oSettings );
iPushFeature = 1;
}
else if ( cOption == 'r' && oSettings.oFeatures.bProcessing )
{
/* pRocessing */
nTmp = _fnFeatureHtmlProcessing( oSettings );
iPushFeature = 1;
}
else if ( cOption == 't' )
{
/* Table */
nTmp = _fnFeatureHtmlTable( oSettings );
iPushFeature = 1;
}
else if ( cOption == 'i' && oSettings.oFeatures.bInfo )
{
/* Info */
nTmp = _fnFeatureHtmlInfo( oSettings );
iPushFeature = 1;
}
else if ( cOption == 'p' && oSettings.oFeatures.bPaginate )
{
/* Pagination */
nTmp = _fnFeatureHtmlPaginate( oSettings );
iPushFeature = 1;
}
else if ( _oExt.aoFeatures.length !== 0 )
{
/* Plug-in features */
var aoFeatures = _oExt.aoFeatures;
for ( var k=0, kLen=aoFeatures.length ; kcaption', oSettings.nTable);
for ( var i=0, iLen=nCaptions.length ; i
$(oSettings.nTable).height() - oSettings.oScroll.iLoadGap )
{
/* Only do the redraw if we have to - we might be at the end of the data */
if ( oSettings.fnDisplayEnd() < oSettings.fnRecordsDisplay() )
{
_fnPageChange( oSettings, 'next' );
_fnCalculateEnd( oSettings );
_fnDraw( oSettings );
}
}
}
} );
}
oSettings.nScrollHead = nScrollHead;
oSettings.nScrollFoot = nScrollFoot;
return nScroller;
}
/*
* Function: _fnScrollDraw
* Purpose: Update the various tables for resizing
* Returns: node: - Node to add to the DOM
* Inputs: object:o - dataTables settings object
* Notes: It's a bit of a pig this function, but basically the idea to:
* 1. Re-create the table inside the scrolling div
* 2. Take live measurements from the DOM
* 3. Apply the measurements
* 4. Clean up
*/
function _fnScrollDraw ( o )
{
var
nScrollHeadInner = o.nScrollHead.getElementsByTagName('div')[0],
nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
nScrollBody = o.nTable.parentNode,
i, iLen, j, jLen, anHeadToSize, anHeadSizers, anFootSizers, anFootToSize, oStyle, iVis,
iWidth, aApplied=[], iSanityWidth;
/*
* 1. Re-create the table inside the scrolling div
*/
/* Remove the old minimised thead and tfoot elements in the inner table */
var nTheadSize = o.nTable.getElementsByTagName('thead');
if ( nTheadSize.length > 0 )
{
o.nTable.removeChild( nTheadSize[0] );
}
if ( o.nTFoot !== null )
{
/* Remove the old minimised footer element in the cloned header */
var nTfootSize = o.nTable.getElementsByTagName('tfoot');
if ( nTfootSize.length > 0 )
{
o.nTable.removeChild( nTfootSize[0] );
}
}
/* Clone the current header and footer elements and then place it into the inner table */
nTheadSize = o.nTHead.cloneNode(true);
o.nTable.insertBefore( nTheadSize, o.nTable.childNodes[0] );
if ( o.nTFoot !== null )
{
nTfootSize = o.nTFoot.cloneNode(true);
o.nTable.insertBefore( nTfootSize, o.nTable.childNodes[1] );
}
/*
* 2. Take live measurements from the DOM - do not alter the DOM itself!
*/
/* Remove old sizing and apply the calculated column widths
* Get the unique column headers in the newly created (cloned) header. We want to apply the
* calclated sizes to this header
*/
var nThs = _fnGetUniqueThs( nTheadSize );
for ( i=0, iLen=nThs.length ; i iSanityWidth-o.oScroll.iBarWidth )
{
/* Not possible to take account of it */
o.nTable.style.width = _fnStringToCss( iSanityWidth );
}
}
else
{
/* All else fails */
o.nTable.style.width = _fnStringToCss( iSanityWidth );
}
}
/* Recalculate the sanity width - now that we've applied the required width, before it was
* a temporary variable. This is required because the column width calculation is done
* before this table DOM is created.
*/
iSanityWidth = $(o.nTable).outerWidth();
/* We want the hidden header to have zero height, so remove padding and borders. Then
* set the width based on the real headers
*/
anHeadToSize = o.nTHead.getElementsByTagName('tr');
anHeadSizers = nTheadSize.getElementsByTagName('tr');
_fnApplyToChildren( function(nSizer, nToSize) {
oStyle = nSizer.style;
oStyle.paddingTop = "0";
oStyle.paddingBottom = "0";
oStyle.borderTopWidth = "0";
oStyle.borderBottomWidth = "0";
oStyle.height = 0;
iWidth = $(nSizer).width();
nToSize.style.width = _fnStringToCss( iWidth );
aApplied.push( iWidth );
}, anHeadSizers, anHeadToSize );
$(anHeadSizers).height(0);
if ( o.nTFoot !== null )
{
/* Clone the current footer and then place it into the body table as a "hidden header" */
anFootSizers = nTfootSize.getElementsByTagName('tr');
anFootToSize = o.nTFoot.getElementsByTagName('tr');
_fnApplyToChildren( function(nSizer, nToSize) {
oStyle = nSizer.style;
oStyle.paddingTop = "0";
oStyle.paddingBottom = "0";
oStyle.borderTopWidth = "0";
oStyle.borderBottomWidth = "0";
iWidth = $(nSizer).width();
nToSize.style.width = _fnStringToCss( iWidth );
aApplied.push( iWidth );
}, anFootSizers, anFootToSize );
$(anFootSizers).height(0);
}
/*
* 3. Apply the measurements
*/
/* "Hide" the header and footer that we used for the sizing. We want to also fix their width
* to what they currently are
*/
_fnApplyToChildren( function(nSizer) {
nSizer.innerHTML = "";
nSizer.style.width = _fnStringToCss( aApplied.shift() );
}, anHeadSizers );
if ( o.nTFoot !== null )
{
_fnApplyToChildren( function(nSizer) {
nSizer.innerHTML = "";
nSizer.style.width = _fnStringToCss( aApplied.shift() );
}, anFootSizers );
}
/* Sanity check that the table is of a sensible width. If not then we are going to get
* misalignment
*/
if ( $(o.nTable).outerWidth() < iSanityWidth )
{
if ( o.oScroll.sX === "" )
{
_fnLog( o, 1, "The table cannot fit into the current element which will cause column"+
" misalignment. It is suggested that you enable x-scrolling or increase the width"+
" the table has in which to be drawn" );
}
else if ( o.oScroll.sXInner !== "" )
{
_fnLog( o, 1, "The table cannot fit into the current element which will cause column"+
" misalignment. It is suggested that you increase the sScrollXInner property to"+
" allow it to draw in a larger area, or simply remove that parameter to allow"+
" automatic calculation" );
}
}
/*
* 4. Clean up
*/
if ( o.oScroll.sY === "" )
{
/* IE7< puts a vertical scrollbar in place (when it shouldn't be) due to subtracting
* the scrollbar height from the visible display, rather than adding it on. We need to
* set the height in order to sort this. Don't want to do it in any other browsers.
*/
if ( $.browser.msie && $.browser.version <= 7 )
{
nScrollBody.style.height = _fnStringToCss( o.nTable.offsetHeight+o.oScroll.iBarWidth );
}
}
if ( o.oScroll.sY !== "" && o.oScroll.bCollapse )
{
nScrollBody.style.height = _fnStringToCss( o.oScroll.sY );
var iExtra = (o.oScroll.sX !== "" && o.nTable.offsetWidth > nScrollBody.offsetWidth) ?
o.oScroll.iBarWidth : 0;
if ( o.nTable.offsetHeight < nScrollBody.offsetHeight )
{
nScrollBody.style.height = _fnStringToCss( $(o.nTable).height()+iExtra );
}
}
/* Finally set the width's of the header and footer tables */
var iOuterWidth = $(o.nTable).outerWidth();
nScrollHeadTable.style.width = _fnStringToCss( iOuterWidth );
nScrollHeadInner.style.width = _fnStringToCss( iOuterWidth+o.oScroll.iBarWidth );
nScrollHeadInner.parentNode.style.width = _fnStringToCss( $(nScrollBody).width() );
if ( o.nTFoot !== null )
{
var
nScrollFootInner = o.nScrollFoot.getElementsByTagName('div')[0],
nScrollFootTable = nScrollFootInner.getElementsByTagName('table')[0];
nScrollFootInner.style.width = _fnStringToCss( o.nTable.offsetWidth+o.oScroll.iBarWidth );
nScrollFootTable.style.width = _fnStringToCss( o.nTable.offsetWidth );
}
/* If sorting or filtering has occured, jump the scrolling back to the top */
if ( o.bSorted || o.bFiltered )
{
nScrollBody.scrollTop = 0;
}
}
/*
* Function: _fnAjustColumnSizing
* Purpose: Ajust the table column widths for new data
* Returns: -
* Inputs: object:oSettings - dataTables settings object
* Notes: You would probably want to do a redraw after calling this function!
*/
function _fnAjustColumnSizing ( oSettings )
{
/* Not interested in doing column width calculation if autowidth is disabled */
if ( oSettings.oFeatures.bAutoWidth === false )
{
return false;
}
_fnCalculateColumnWidths( oSettings );
for ( var i=0 , iLen=oSettings.aoColumns.length ; i ';
var jqFilter = $("input", nFilter);
jqFilter.val( oSettings.oPreviousSearch.sSearch.replace('"','"') );
jqFilter.keyup( function(e) {
/* Update all other filter input elements for the new display */
var n = oSettings.aanFeatures.f;
for ( var i=0, iLen=n.length ; i=0 ; i-- )
{
var sData = _fnDataToSearch( oSettings.aoData[ oSettings.aiDisplay[i] ]._aData[iColumn],
oSettings.aoColumns[iColumn].sType );
if ( ! rpSearch.test( sData ) )
{
oSettings.aiDisplay.splice( i, 1 );
iIndexCorrector++;
}
}
}
/*
* Function: _fnFilter
* Purpose: Filter the data table based on user input and draw the table
* Returns: -
* Inputs: object:oSettings - dataTables settings object
* string:sInput - string to filter on
* int:iForce - optional - force a research of the master array (1) or not (undefined or 0)
* bool:bRegex - treat as a regular expression or not
* bool:bSmart - perform smart filtering or not
*/
function _fnFilter( oSettings, sInput, iForce, bRegex, bSmart )
{
var i;
var rpSearch = _fnFilterCreateSearch( sInput, bRegex, bSmart );
/* Check if we are forcing or not - optional parameter */
if ( typeof iForce == 'undefined' || iForce === null )
{
iForce = 0;
}
/* Need to take account of custom filtering functions - always filter */
if ( _oExt.afnFiltering.length !== 0 )
{
iForce = 1;
}
/*
* If the input is blank - we want the full data set
*/
if ( sInput.length <= 0 )
{
oSettings.aiDisplay.splice( 0, oSettings.aiDisplay.length);
oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
}
else
{
/*
* We are starting a new search or the new search string is smaller
* then the old one (i.e. delete). Search from the master array
*/
if ( oSettings.aiDisplay.length == oSettings.aiDisplayMaster.length ||
oSettings.oPreviousSearch.sSearch.length > sInput.length || iForce == 1 ||
sInput.indexOf(oSettings.oPreviousSearch.sSearch) !== 0 )
{
/* Nuke the old display array - we are going to rebuild it */
oSettings.aiDisplay.splice( 0, oSettings.aiDisplay.length);
/* Force a rebuild of the search array */
_fnBuildSearchArray( oSettings, 1 );
/* Search through all records to populate the search array
* The the oSettings.aiDisplayMaster and asDataSearch arrays have 1 to 1
* mapping
*/
for ( i=0 ; i tag - remove it */
sSearch = sSearch.replace(/\n/g," ").replace(/\r/g,"");
}
return sSearch;
}
/*
* Function: _fnFilterCreateSearch
* Purpose: Build a regular expression object suitable for searching a table
* Returns: RegExp: - constructed object
* Inputs: string:sSearch - string to search for
* bool:bRegex - treat as a regular expression or not
* bool:bSmart - perform smart filtering or not
*/
function _fnFilterCreateSearch( sSearch, bRegex, bSmart )
{
var asSearch, sRegExpString;
if ( bSmart )
{
/* Generate the regular expression to use. Something along the lines of:
* ^(?=.*?\bone\b)(?=.*?\btwo\b)(?=.*?\bthree\b).*$
*/
asSearch = bRegex ? sSearch.split( ' ' ) : _fnEscapeRegex( sSearch ).split( ' ' );
sRegExpString = '^(?=.*?'+asSearch.join( ')(?=.*?' )+').*$';
return new RegExp( sRegExpString, "i" );
}
else
{
sSearch = bRegex ? sSearch : _fnEscapeRegex( sSearch );
return new RegExp( sSearch, "i" );
}
}
/*
* Function: _fnDataToSearch
* Purpose: Convert raw data into something that the user can search on
* Returns: string: - search string
* Inputs: string:sData - data to be modified
* string:sType - data type
*/
function _fnDataToSearch ( sData, sType )
{
if ( typeof _oExt.ofnSearch[sType] == "function" )
{
return _oExt.ofnSearch[sType]( sData );
}
else if ( sType == "html" )
{
return sData.replace(/\n/g," ").replace( /<.*?>/g, "" );
}
else if ( typeof sData == "string" )
{
return sData.replace(/\n/g," ");
}
return sData;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Section - Feature: Sorting
*/
/*
* Function: _fnSort
* Purpose: Change the order of the table
* Returns: -
* Inputs: object:oSettings - dataTables settings object
* bool:bApplyClasses - optional - should we apply classes or not
* Notes: We always sort the master array and then apply a filter again
* if it is needed. This probably isn't optimal - but atm I can't think
* of any other way which is (each has disadvantages). we want to sort aiDisplayMaster -
* but according to aoData[]._aData
*/
function _fnSort ( oSettings, bApplyClasses )
{
var
iDataSort, iDataType,
i, iLen, j, jLen,
aaSort = [],
aiOrig = [],
oSort = _oExt.oSort,
aoData = oSettings.aoData,
aoColumns = oSettings.aoColumns;
/* No sorting required if server-side or no sorting array */
if ( !oSettings.oFeatures.bServerSide &&
(oSettings.aaSorting.length !== 0 || oSettings.aaSortingFixed !== null) )
{
if ( oSettings.aaSortingFixed !== null )
{
aaSort = oSettings.aaSortingFixed.concat( oSettings.aaSorting );
}
else
{
aaSort = oSettings.aaSorting.slice();
}
/* If there is a sorting data type, and a fuction belonging to it, then we need to
* get the data from the developer's function and apply it for this column
*/
for ( i=0 ; i= iColumns )
{
for ( i=0 ; i=0 ?
oSettings._iDisplayStart - oSettings._iDisplayLength :
0;
/* Correct for underrun */
if ( oSettings._iDisplayStart < 0 )
{
oSettings._iDisplayStart = 0;
}
}
else if ( sAction == "next" )
{
if ( oSettings._iDisplayLength >= 0 )
{
/* Make sure we are not over running the display array */
if ( oSettings._iDisplayStart + oSettings._iDisplayLength < oSettings.fnRecordsDisplay() )
{
oSettings._iDisplayStart += oSettings._iDisplayLength;
}
}
else
{
oSettings._iDisplayStart = 0;
}
}
else if ( sAction == "last" )
{
if ( oSettings._iDisplayLength >= 0 )
{
var iPages = parseInt( (oSettings.fnRecordsDisplay()-1) / oSettings._iDisplayLength, 10 ) + 1;
oSettings._iDisplayStart = (iPages-1) * oSettings._iDisplayLength;
}
else
{
oSettings._iDisplayStart = 0;
}
}
else
{
_fnLog( oSettings, 0, "Unknown paging action: "+sAction );
}
return iOldStart != oSettings._iDisplayStart;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Section - Feature: HTML info
*/
/*
* Function: _fnFeatureHtmlInfo
* Purpose: Generate the node required for the info display
* Returns: node
* Inputs: object:oSettings - dataTables settings object
*/
function _fnFeatureHtmlInfo ( oSettings )
{
var nInfo = document.createElement( 'div' );
nInfo.className = oSettings.oClasses.sInfo;
/* Actions that are to be taken once only for this feature */
if ( typeof oSettings.aanFeatures.i == "undefined" )
{
/* Add draw callback */
oSettings.aoDrawCallback.push( {
"fn": _fnUpdateInfo,
"sName": "information"
} );
/* Add id */
if ( oSettings.sTableId !== '' )
{
nInfo.setAttribute( 'id', oSettings.sTableId+'_info' );
}
}
return nInfo;
}
/*
* Function: _fnUpdateInfo
* Purpose: Update the information elements in the display
* Returns: -
* Inputs: object:oSettings - dataTables settings object
*/
function _fnUpdateInfo ( oSettings )
{
/* Show information about the table */
if ( !oSettings.oFeatures.bInfo || oSettings.aanFeatures.i.length === 0 )
{
return;
}
var
iStart = oSettings._iDisplayStart+1, iEnd = oSettings.fnDisplayEnd(),
iMax = oSettings.fnRecordsTotal(), iTotal = oSettings.fnRecordsDisplay(),
sStart = oSettings.fnFormatNumber( iStart ), sEnd = oSettings.fnFormatNumber( iEnd ),
sMax = oSettings.fnFormatNumber( iMax ), sTotal = oSettings.fnFormatNumber( iTotal ),
sOut;
/* When infinite scrolling, we are always starting at 1. _iDisplayStart is used only
* internally
*/
if ( oSettings.oScroll.bInfinite )
{
sStart = oSettings.fnFormatNumber( 1 );
}
if ( oSettings.fnRecordsDisplay() === 0 &&
oSettings.fnRecordsDisplay() == oSettings.fnRecordsTotal() )
{
/* Empty record set */
sOut = oSettings.oLanguage.sInfoEmpty+ oSettings.oLanguage.sInfoPostFix;
}
else if ( oSettings.fnRecordsDisplay() === 0 )
{
/* Rmpty record set after filtering */
sOut = oSettings.oLanguage.sInfoEmpty +' '+
oSettings.oLanguage.sInfoFiltered.replace('_MAX_', sMax)+
oSettings.oLanguage.sInfoPostFix;
}
else if ( oSettings.fnRecordsDisplay() == oSettings.fnRecordsTotal() )
{
/* Normal record set */
sOut = oSettings.oLanguage.sInfo.
replace('_START_', sStart).
replace('_END_', sEnd).
replace('_TOTAL_', sTotal)+
oSettings.oLanguage.sInfoPostFix;
}
else
{
/* Record set after filtering */
sOut = oSettings.oLanguage.sInfo.
replace('_START_', sStart).
replace('_END_', sEnd).
replace('_TOTAL_', sTotal) +' '+
oSettings.oLanguage.sInfoFiltered.replace('_MAX_',
oSettings.fnFormatNumber(oSettings.fnRecordsTotal()))+
oSettings.oLanguage.sInfoPostFix;
}
if ( oSettings.oLanguage.fnInfoCallback !== null )
{
sOut = oSettings.oLanguage.fnInfoCallback( oSettings, iStart, iEnd, iMax, iTotal, sOut );
}
var n = oSettings.aanFeatures.i;
for ( var i=0, iLen=n.length ; i';
var i, iLen;
if ( oSettings.aLengthMenu.length == 2 && typeof oSettings.aLengthMenu[0] == 'object' &&
typeof oSettings.aLengthMenu[1] == 'object' )
{
for ( i=0, iLen=oSettings.aLengthMenu[0].length ; i'+
oSettings.aLengthMenu[1][i]+'';
}
}
else
{
for ( i=0, iLen=oSettings.aLengthMenu.length ; i'+
oSettings.aLengthMenu[i]+'';
}
}
sStdMenu += '';
var nLength = document.createElement( 'div' );
if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.l == "undefined" )
{
nLength.setAttribute( 'id', oSettings.sTableId+'_length' );
}
nLength.className = oSettings.oClasses.sLength;
nLength.innerHTML = oSettings.oLanguage.sLengthMenu.replace( '_MENU_', sStdMenu );
/*
* Set the length to the current display length - thanks to Andrea Pavlovic for this fix,
* and Stefan Skopnik for fixing the fix!
*/
$('select option[value="'+oSettings._iDisplayLength+'"]',nLength).attr("selected",true);
$('select', nLength).change( function(e) {
var iVal = $(this).val();
/* Update all other length options for the new display */
var n = oSettings.aanFeatures.l;
for ( i=0, iLen=n.length ; i oSettings.aiDisplay.length ||
oSettings._iDisplayLength == -1 )
{
oSettings._iDisplayEnd = oSettings.aiDisplay.length;
}
else
{
oSettings._iDisplayEnd = oSettings._iDisplayStart + oSettings._iDisplayLength;
}
}
}
/*
* Function: _fnConvertToWidth
* Purpose: Convert a CSS unit width to pixels (e.g. 2em)
* Returns: int:iWidth - width in pixels
* Inputs: string:sWidth - width to be converted
* node:nParent - parent to get the with for (required for
* relative widths) - optional
*/
function _fnConvertToWidth ( sWidth, nParent )
{
if ( !sWidth || sWidth === null || sWidth === '' )
{
return 0;
}
if ( typeof nParent == "undefined" )
{
nParent = document.getElementsByTagName('body')[0];
}
var iWidth;
var nTmp = document.createElement( "div" );
nTmp.style.width = sWidth;
nParent.appendChild( nTmp );
iWidth = nTmp.offsetWidth;
nParent.removeChild( nTmp );
return ( iWidth );
}
/*
* Function: _fnCalculateColumnWidths
* Purpose: Calculate the width of columns for the table
* Returns: -
* Inputs: object:oSettings - dataTables settings object
*/
function _fnCalculateColumnWidths ( oSettings )
{
var iTableWidth = oSettings.nTable.offsetWidth;
var iUserInputs = 0;
var iTmpWidth;
var iVisibleColumns = 0;
var iColums = oSettings.aoColumns.length;
var i;
var oHeaders = $('th', oSettings.nTHead);
/* Convert any user input sizes into pixel sizes */
for ( i=0 ; itd', nCalcTmp);
}
jqColSizing.each( function (i) {
this.style.width = "";
var iIndex = _fnVisibleToColumnIndex( oSettings, i );
if ( iIndex !== null && oSettings.aoColumns[iIndex].sWidthOrig !== "" )
{
this.style.width = oSettings.aoColumns[iIndex].sWidthOrig;
}
} );
/* Find the biggest td for each column and put it into the table */
for ( i=0 ; itd", nCalcTmp);
if ( oNodes.length === 0 )
{
oNodes = $("thead tr:eq(0)>th", nCalcTmp);
}
var iIndex, iCorrector = 0, iWidth;
for ( i=0 ; i 0 )
{
oSettings.aoColumns[i].sWidth = _fnStringToCss( iWidth );
}
iCorrector++;
}
}
oSettings.nTable.style.width = _fnStringToCss( $(nCalcTmp).outerWidth() );
nCalcTmp.parentNode.removeChild( nCalcTmp );
}
}
/*
* Function: _fnScrollingWidthAdjust
* Purpose: Adjust a table's width to take account of scrolling
* Returns: -
* Inputs: object:oSettings - dataTables settings object
* node:n - table node
*/
function _fnScrollingWidthAdjust ( oSettings, n )
{
if ( oSettings.oScroll.sX === "" && oSettings.oScroll.sY !== "" )
{
/* When y-scrolling only, we want to remove the width of the scroll bar so the table
* + scroll bar will fit into the area avaialble.
*/
var iOrigWidth = $(n).width();
n.style.width = _fnStringToCss( $(n).outerWidth()-oSettings.oScroll.iBarWidth );
}
else if ( oSettings.oScroll.sX !== "" )
{
/* When x-scrolling both ways, fix the table at it's current size, without adjusting */
n.style.width = _fnStringToCss( $(n).outerWidth() );
}
}
/*
* Function: _fnGetWidestNode
* Purpose: Get the widest node
* Returns: string: - max strlens for each column
* Inputs: object:oSettings - dataTables settings object
* int:iCol - column of interest
* boolean:bFast - Should we use fast (but non-accurate) calculation - optional,
* default true
* Notes: This operation is _expensive_ (!!!). It requires a lot of DOM interaction, but
* this is the only way to reliably get the widest string. For example 'mmm' would be wider
* than 'iiii' so we can't just ocunt characters. If this can be optimised it would be good
* to do so!
*/
function _fnGetWidestNode( oSettings, iCol, bFast )
{
/* Use fast not non-accurate calculate based on the strlen */
if ( typeof bFast == 'undefined' || bFast )
{
var iMaxLen = _fnGetMaxLenString( oSettings, iCol );
var iFastVis = _fnColumnIndexToVisible( oSettings, iCol);
if ( iMaxLen < 0 )
{
return null;
}
return oSettings.aoData[iMaxLen].nTr.getElementsByTagName('td')[iFastVis];
}
/* Use the slow approach, but get high quality answers - note that this code is not actually
* used by DataTables by default. If you want to use it you can alter the call to
* _fnGetWidestNode to pass 'false' as the third argument
*/
var
iMax = -1, i, iLen,
iMaxIndex = -1,
n = document.createElement('div');
n.style.visibility = "hidden";
n.style.position = "absolute";
document.body.appendChild( n );
for ( i=0, iLen=oSettings.aoData.length ; i iMax )
{
iMax = n.offsetWidth;
iMaxIndex = i;
}
}
document.body.removeChild( n );
if ( iMaxIndex >= 0 )
{
var iVis = _fnColumnIndexToVisible( oSettings, iCol);
var nRet = oSettings.aoData[iMaxIndex].nTr.getElementsByTagName('td')[iVis];
if ( nRet )
{
return nRet;
}
}
return null;
}
/*
* Function: _fnGetMaxLenString
* Purpose: Get the maximum strlen for each data column
* Returns: string: - max strlens for each column
* Inputs: object:oSettings - dataTables settings object
* int:iCol - column of interest
*/
function _fnGetMaxLenString( oSettings, iCol )
{
var iMax = -1;
var iMaxIndex = -1;
for ( var i=0 ; i iMax )
{
iMax = s.length;
iMaxIndex = i;
}
}
return iMaxIndex;
}
/*
* Function: _fnStringToCss
* Purpose: Append a CSS unit (only if required) to a string
* Returns: 0 if match, 1 if length is different, 2 if no match
* Inputs: array:aArray1 - first array
* array:aArray2 - second array
*/
function _fnStringToCss( s )
{
if ( s === null )
{
return "0px";
}
if ( typeof s == 'number' )
{
if ( s < 0 )
{
return "0px";
}
return s+"px";
}
/* Check if the last character is not 0-9 */
var c = s.charCodeAt( s.length-1 );
if (c < 0x30 || c > 0x39)
{
return s;
}
return s+"px";
}
/*
* Function: _fnArrayCmp
* Purpose: Compare two arrays
* Returns: 0 if match, 1 if length is different, 2 if no match
* Inputs: array:aArray1 - first array
* array:aArray2 - second array
*/
function _fnArrayCmp( aArray1, aArray2 )
{
if ( aArray1.length != aArray2.length )
{
return 1;
}
for ( var i=0 ; i iTarget )
{
a[i]--;
}
}
if ( iTargetIndex != -1 )
{
a.splice( iTargetIndex, 1 );
}
}
/*
* Function: _fnReOrderIndex
* Purpose: Figure out how to reorder a display list
* Returns: array int:aiReturn - index list for reordering
* Inputs: object:oSettings - dataTables settings object
*/
function _fnReOrderIndex ( oSettings, sColumns )
{
var aColumns = sColumns.split(',');
var aiReturn = [];
for ( var i=0, iLen=oSettings.aoColumns.length ; i 4096 ) /* Magic 10 for padding */
{
var aCookies =document.cookie.split(';');
for ( var i=0, iLen=aCookies.length ; itr', this);
for ( i=0, iLen=oSettings.asStripClasses.length ; i=0 ; i-- )
{
/* Each column def can target multiple columns, as it is an array */
var aTargets = oInit.aoColumnDefs[i].aTargets;
if ( !$.isArray( aTargets ) )
{
_fnLog( oSettings, 1, 'aTargets must be an array of targets, not a '+(typeof aTargets) );
}
for ( j=0, jLen=aTargets.length ; j= 0 )
{
/* 0+ integer, left to right column counting. We add columns which are unknown
* automatically. Is this the right behaviour for this? We should at least
* log it in future. We cannot do this for the negative or class targets, only here.
*/
while( oSettings.aoColumns.length <= aTargets[j] )
{
_fnAddColumn( oSettings );
}
_fnColumnOptions( oSettings, aTargets[j], oInit.aoColumnDefs[i] );
}
else if ( typeof aTargets[j] == 'number' && aTargets[j] < 0 )
{
/* Negative integer, right to left column counting */
_fnColumnOptions( oSettings, oSettings.aoColumns.length+aTargets[j],
oInit.aoColumnDefs[i] );
}
else if ( typeof aTargets[j] == 'string' )
{
/* Class name matching on TH element */
for ( k=0, kLen=oSettings.aoColumns.length ; k= oSettings.aoColumns.length )
{
oSettings.aaSorting[i][0] = 0;
}
var oColumn = oSettings.aoColumns[ oSettings.aaSorting[i][0] ];
/* Add a default sorting index */
if ( typeof oSettings.aaSorting[i][2] == 'undefined' )
{
oSettings.aaSorting[i][2] = 0;
}
/* If aaSorting is not defined, then we use the first indicator in asSorting */
if ( typeof oInit.aaSorting == "undefined" &&
typeof oSettings.saved_aaSorting == "undefined" )
{
oSettings.aaSorting[i][1] = oColumn.asSorting[0];
}
/* Set the current sorting index based on aoColumns.asSorting */
for ( j=0, jLen=oColumn.asSorting.length ; j 0 )
{
oSettings.nTFoot = this.getElementsByTagName('tfoot')[0];
}
/* Check if there is data passing into the constructor */
if ( bUsePassedData )
{
for ( i=0 ; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy