*
* Note that as of v1.9, it is typically preferable to use mDataProp to prepare data for
* the different uses that DataTables can put the data to. Specifically mDataProp when
* used as a function will give you a 'type' (sorting, filtering etc) that you can use to
* prepare the data as required for the different types. As such, this method is deprecated.
* @type array
* @default []
* @deprecated
*
* @example
* // Updating the cached sorting information with user entered values in HTML input elements
* jQuery.fn.dataTableExt.afnSortData['dom-text'] = function ( oSettings, iColumn )
* {
* var aData = [];
* $( 'td:eq('+iColumn+') input', oSettings.oApi._fnGetTrNodes(oSettings) ).each( function () {
* aData.push( this.value );
* } );
* return aData;
* }
*/
"afnSortData": [],
/**
* Feature plug-ins - This is an array of objects which describe the feature plug-ins that are
* available to DataTables. These feature plug-ins are accessible through the sDom initialisation
* option. As such, each feature plug-in must describe a function that is used to initialise
* itself (fnInit), a character so the feature can be enabled by sDom (cFeature) and the name
* of the feature (sFeature). Thus the objects attached to this method must provide:
*

{node|null} The element which contains your feature. Note that the return
* may also be void if your plug-in does not require to inject any DOM elements
* into DataTables control (sDom) - for example this might be useful when
* developing a plug-in which allows table control via keyboard entry.

*

*
*

*

*

{character} cFeature Character that will be matched in sDom - case sensitive

*

{string} sFeature Feature name

*

* @type array
* @default []
*
* @example
* // How TableTools initialises itself.
* $.fn.dataTableExt.aoFeatures.push( {
* "fnInit": function( oSettings ) {
* return new TableTools( { "oDTSettings": oSettings } );
* },
* "cFeature": "T",
* "sFeature": "TableTools"
* } );
*/
"aoFeatures": [],
/**
* Type detection plug-in functions - DataTables utilises types to define how sorting and
* filtering behave, and types can be either be defined by the developer (sType for the
* column) or they can be automatically detected by the methods in this array. The functions
* defined in the array are quite simple, taking a single parameter (the data to analyse)
* and returning the type if it is a known type, or null otherwise.
*

*

* Function input parameters:
*

*

{*} Data from the column cell to be analysed

*

*

*

* Function return:
*

*

{string|null} Data type detected, or null if unknown (and thus pass it
* on to the other type detection functions.

*

*
*

* @type array
* @default []
*
* @example
* // Currency type detection plug-in:
* jQuery.fn.dataTableExt.aTypes.push(
* function ( sData ) {
* var sValidChars = "0123456789.-";
* var Char;
*
* // Check the numeric part
* for ( i=1 ; i= parseInt(sThat, 10);
},
/**
* Index for what 'this' index API functions should use
* @type int
* @default 0
*/
"iApiIndex": 0,
/**
* Pre-processing of filtering data plug-ins - When you assign the sType for a column
* (or have it automatically detected for you by DataTables or a type detection plug-in),
* you will typically be using this for custom sorting, but it can also be used to provide
* custom filtering by allowing you to pre-processing the data and returning the data in
* the format that should be filtered upon. This is done by adding functions this object
* with a parameter name which matches the sType for that target column. This is the
* corollary of afnSortData for filtering data.
*

*

* Function input parameters:
*

*

{*} Data from the column cell to be prepared for filtering

*

*

*

* Function return:
*

*

{string|null} Formatted string that will be used for the filtering.

*

*
*

*
* Note that as of v1.9, it is typically preferable to use mDataProp to prepare data for
* the different uses that DataTables can put the data to. Specifically mDataProp when
* used as a function will give you a 'type' (sorting, filtering etc) that you can use to
* prepare the data as required for the different types. As such, this method is deprecated.
* @type object
* @default {}
* @deprecated
*
* @example
* $.fn.dataTableExt.ofnSearch['title-numeric'] = function ( sData ) {
* return sData.replace(/\n/g," ").replace( //g, "" );
* }
*/
"ofnSearch": {},
/**
* Container for all private functions in DataTables so they can be exposed externally
* @type object
* @default {}
*/
"oApi": {},
/**
* Storage for the various classes that DataTables uses
* @type object
* @default {}
*/
"oStdClasses": {},
/**
* Storage for the various classes that DataTables uses - jQuery UI suitable
* @type object
* @default {}
*/
"oJUIClasses": {},
/**
* Pagination plug-in methods - The style and controls of the pagination can significantly
* impact on how the end user interacts with the data in your table, and DataTables allows
* the addition of pagination controls by extending this object, which can then be enabled
* through the sPaginationType initialisation parameter. Each pagination type that
* is added is an object (the property name of which is what sPaginationType refers
* to) that has two properties, both methods that are used by DataTables to update the
* control's state.
*

*

* fnInit - Initialisation of the paging controls. Called only during initialisation
* of the table. It is expected that this function will add the required DOM elements
* to the page for the paging controls to work. The element pointer
* 'oSettings.aanFeatures.p' array is provided by DataTables to contain the paging
* controls (note that this is a 2D array to allow for multiple instances of each
* DataTables DOM element). It is suggested that you add the controls to this element
* as children
*

{int} Sorting match: <0 if first parameter should be sorted lower than
* the second parameter, ===0 if the two parameters are equal and >0 if
* the first parameter should be sorted height than the second parameter.

*

*
*
* @type object
* @default {}
*
* @example
* // Case-sensitive string sorting, with no pre-formatting method
* $.extend( $.fn.dataTableExt.oSort, {
* "string-case-asc": function(x,y) {
* return ((x < y) ? -1 : ((x > y) ? 1 : 0));
* },
* "string-case-desc": function(x,y) {
* return ((x < y) ? 1 : ((x > y) ? -1 : 0));
* }
* } );
*
* @example
* // Case-insensitive string sorting, with pre-formatting
* $.extend( $.fn.dataTableExt.oSort, {
* "string-pre": function(x) {
* return x.toLowerCase();
* },
* "string-asc": function(x,y) {
* return ((x < y) ? -1 : ((x > y) ? 1 : 0));
* },
* "string-desc": function(x,y) {
* return ((x < y) ? 1 : ((x > y) ? -1 : 0));
* }
* } );
*/
"oSort": {},
/**
* Version string for plug-ins to check compatibility. 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
* @type string
* @default Version number
*/
"sVersion": DataTable.version,
/**
* How should DataTables report an error. Can take the value 'alert' or 'throw'
* @type string
* @default alert
*/
"sErrMode": "alert",
/**
* Store information for DataTables to access globally about other instances
* @namespace
* @private
*/
"_oExternConfig": {
/* int:iNextUnique - next unique number for an instance */
"iNextUnique": 0
}
};
/**
* Template object for the way in which DataTables holds information about
* search information for the global filter and individual column filters.
* @namespace
*/
DataTable.models.oSearch = {
/**
* Flag to indicate if the filtering should be case insensitive or not
* @type boolean
* @default true
*/
"bCaseInsensitive": true,
/**
* Applied search term
* @type string
* @default Empty string
*/
"sSearch": "",
/**
* Flag to indicate if the search term should be interpreted as a
* regular expression (true) or not (false) and therefore and special
* regex characters escaped.
* @type boolean
* @default false
*/
"bRegex": false,
/**
* Flag to indicate if DataTables is to use its smart filtering or not.
* @type boolean
* @default true
*/
"bSmart": true
};
/**
* Template object for the way in which DataTables holds information about
* each individual row. This is the object format used for the settings
* aoData array.
* @namespace
*/
DataTable.models.oRow = {
/**
* TR element for the row
* @type node
* @default null
*/
"nTr": null,
/**
* Data object from the original data source for the row. This is either
* an array if using the traditional form of DataTables, or an object if
* using mDataProp options. The exact type will depend on the passed in
* data from the data source, or will be an array if using DOM a data
* source.
* @type array|object
* @default []
*/
"_aData": [],
/**
* Sorting data cache - this array is ostensibly the same length as the
* number of columns (although each index is generated only as it is
* needed), and holds the data that is used for sorting each column in the
* row. We do this cache generation at the start of the sort in order that
* the formatting of the sort data need be done only once for each cell
* per sort. This array should not be read from or written to by anything
* other than the master sorting methods.
* @type array
* @default []
* @private
*/
"_aSortData": [],
/**
* Array of TD elements that are cached for hidden rows, so they can be
* reinserted into the table if a column is made visible again (or to act
* as a store if a column is made hidden). Only hidden columns have a
* reference in the array. For non-hidden columns the value is either
* undefined or null.
* @type array nodes
* @default []
* @private
*/
"_anHidden": [],
/**
* Cache of the class name that DataTables has applied to the row, so we
* can quickly look at this variable rather than needing to do a DOM check
* on className for the nTr property.
* @type string
* @default Empty string
* @private
*/
"_sRowStripe": ""
};
/**
* Template object for the column information object in DataTables. This object
* is held in the settings aoColumns array and contains all the information that
* DataTables needs about each individual column.
*
* Note that this object is related to {@link DataTable.defaults.columns}
* but this one is the internal data store for DataTables's cache of columns.
* It should NOT be manipulated outside of DataTables. Any configuration should
* be done through the initialisation options.
* @namespace
*/
DataTable.models.oColumn = {
/**
* A list of the columns that sorting should occur on when this column
* is sorted. That this property is an array allows multi-column sorting
* to be defined for a column (for example first name / last name columns
* would benefit from this). The values are integers pointing to the
* columns to be sorted on (typically it will be a single integer pointing
* at itself, but that doesn't need to be the case).
* @type array
*/
"aDataSort": null,
/**
* Define the sorting directions that are applied to the column, in sequence
* as the column is repeatedly sorted upon - i.e. the first value is used
* as the sorting direction when the column if first sorted (clicked on).
* Sort it again (click again) and it will move on to the next index.
* Repeat until loop.
* @type array
*/
"asSorting": null,
/**
* Flag to indicate if the column is searchable, and thus should be included
* in the filtering or not.
* @type boolean
*/
"bSearchable": null,
/**
* Flag to indicate if the column is sortable or not.
* @type boolean
*/
"bSortable": null,
/**
* When using fnRender, you have two options for what to do with the data,
* and this property serves as the switch. Firstly, you can have the sorting
* and filtering use the rendered value (true - default), or you can have
* the sorting and filtering us the original value (false).
*
* *NOTE* It is it is advisable now to use mDataProp as a function and make
* use of the 'type' that it gives, allowing (potentially) different data to
* be used for sorting, filtering, display and type detection.
* @type boolean
* @deprecated
*/
"bUseRendered": null,
/**
* Flag to indicate if the column is currently visible in the table or not
* @type boolean
*/
"bVisible": null,
/**
* Flag to indicate to the type detection method if the automatic type
* detection should be used, or if a column type (sType) has been specified
* @type boolean
* @default true
* @private
*/
"_bAutoType": true,
/**
* Developer definable function that is called whenever a cell is created (Ajax source,
* etc) or processed for input (DOM source). This can be used as a compliment to fnRender
* allowing you to modify the DOM element (add background colour for example) when the
* element is available (since it is not when fnRender is called).
* @type function
* @param {element} nTd The TD node that has been created
* @param {*} sData The Data for the cell
* @param {array|object} oData The data for the whole row
* @param {int} iRow The row index for the aoData data store
* @default null
*/
"fnCreatedCell": null,
/**
* Function to get data from a cell in a column. You should never
* access data directly through _aData internally in DataTables - always use
* the method attached to this property. It allows mDataProp to function as
* required. This function is automatically assigned by the column
* initialisation method
* @type function
* @param {array|object} oData The data array/object for the array
* (i.e. aoData[]._aData)
* @param {string} sSpecific The specific data type you want to get -
* 'display', 'type' 'filter' 'sort'
* @returns {*} The data for the cell from the given row's data
* @default null
*/
"fnGetData": null,
/**
* Custom display function that will be called for the display of each cell
* in this column.
* @type function
* @param {object} o Object with the following parameters:
* @param {int} o.iDataRow The row in aoData
* @param {int} o.iDataColumn The column in question
* @param {array o.aData The data for the row in question
* @param {object} o.oSettings The settings object for this DataTables instance
* @returns {string} The string you which to use in the display
* @default null
*/
"fnRender": null,
/**
* Function to set data for a cell in the column. You should never
* set the data directly to _aData internally in DataTables - always use
* this method. It allows mDataProp to function as required. This function
* is automatically assigned by the column initialisation method
* @type function
* @param {array|object} oData The data array/object for the array
* (i.e. aoData[]._aData)
* @param {*} sValue Value to set
* @default null
*/
"fnSetData": null,
/**
* Property to read the value for the cells in the column from the data
* source array / object. If null, then the default content is used, if a
* function is given then the return from the function is used.
* @type function|int|string|null
* @default null
*/
"mDataProp": null,
/**
* Unique header TH/TD element for this column - this is what the sorting
* listener is attached to (if sorting is enabled.)
* @type node
* @default null
*/
"nTh": null,
/**
* Unique footer TH/TD element for this column (if there is one). Not used
* in DataTables as such, but can be used for plug-ins to reference the
* footer for each column.
* @type node
* @default null
*/
"nTf": null,
/**
* The class to apply to all TD elements in the table's TBODY for the column
* @type string
* @default null
*/
"sClass": null,
/**
* When DataTables calculates the column widths to assign to each column,
* it finds the longest string in each column and then constructs a
* temporary table and reads the widths from that. The problem with this
* is that "mmm" is much wider then "iiii", but the latter is a longer
* string - thus the calculation can go wrong (doing it properly and putting
* it into an DOM object and measuring that is horribly(!) slow). Thus as
* a "work around" we provide this option. It will append its value to the
* text that is found to be the longest string for the column - i.e. padding.
* @type string
*/
"sContentPadding": null,
/**
* Allows a default value to be given for a column's data, and will be used
* whenever a null data source is encountered (this can be because mDataProp
* is set to null, or because the data source itself is null).
* @type string
* @default null
*/
"sDefaultContent": null,
/**
* Name for the column, allowing reference to the column by name as well as
* by index (needs a lookup to work by name).
* @type string
*/
"sName": null,
/**
* Custom sorting data type - defines which of the available plug-ins in
* afnSortData the custom sorting will use - if any is defined.
* @type string
* @default std
*/
"sSortDataType": 'std',
/**
* Class to be applied to the header element when sorting on this column
* @type string
* @default null
*/
"sSortingClass": null,
/**
* Class to be applied to the header element when sorting on this column -
* when jQuery UI theming is used.
* @type string
* @default null
*/
"sSortingClassJUI": null,
/**
* Title of the column - what is seen in the TH element (nTh).
* @type string
*/
"sTitle": null,
/**
* Column sorting and filtering type
* @type string
* @default null
*/
"sType": null,
/**
* Width of the column
* @type string
* @default null
*/
"sWidth": null,
/**
* Width of the column when it was first "encountered"
* @type string
* @default null
*/
"sWidthOrig": null
};
/**
* Initialisation options that can be given to DataTables at initialisation
* time.
* @namespace
*/
DataTable.defaults = {
/**
* An array of data to use for the table, passed in at initialisation which
* will be used in preference to any data which is already in the DOM. This is
* particularly useful for constructing tables purely in Javascript, for
* example with a custom Ajax call.
* @type array
* @default null
* @dtopt Option
*
* @example
* // Using a 2D array data source
* $(document).ready( function () {
* $('#example').dataTable( {
* "aaData": [
* ['Trident', 'Internet Explorer 4.0', 'Win 95+', 4, 'X'],
* ['Trident', 'Internet Explorer 5.0', 'Win 95+', 5, 'C'],
* ],
* "aoColumns": [
* { "sTitle": "Engine" },
* { "sTitle": "Browser" },
* { "sTitle": "Platform" },
* { "sTitle": "Version" },
* { "sTitle": "Grade" }
* ]
* } );
* } );
*
* @example
* // Using an array of objects as a data source (mDataProp)
* $(document).ready( function () {
* $('#example').dataTable( {
* "aaData": [
* {
* "engine": "Trident",
* "browser": "Internet Explorer 4.0",
* "platform": "Win 95+",
* "version": 4,
* "grade": "X"
* },
* {
* "engine": "Trident",
* "browser": "Internet Explorer 5.0",
* "platform": "Win 95+",
* "version": 5,
* "grade": "C"
* }
* ],
* "aoColumns": [
* { "sTitle": "Engine", "mDataProp": "engine" },
* { "sTitle": "Browser", "mDataProp": "browser" },
* { "sTitle": "Platform", "mDataProp": "platform" },
* { "sTitle": "Version", "mDataProp": "version" },
* { "sTitle": "Grade", "mDataProp": "grade" }
* ]
* } );
* } );
*/
"aaData": null,
/**
* If sorting is enabled, then DataTables will perform a first pass sort on
* initialisation. You can define which column(s) the sort is performed upon,
* and the sorting direction, with this variable. The aaSorting array should
* contain an array for each column to be sorted initially containing the
* column's index and a direction string ('asc' or 'desc').
* @type array
* @default [[0,'asc']]
* @dtopt Option
*
* @example
* // Sort by 3rd column first, and then 4th column
* $(document).ready( function() {
* $('#example').dataTable( {
* "aaSorting": [[2,'asc'], [3,'desc']]
* } );
* } );
*
* // No initial sorting
* $(document).ready( function() {
* $('#example').dataTable( {
* "aaSorting": []
* } );
* } );
*/
"aaSorting": [[0,'asc']],
/**
* This parameter is basically identical to the aaSorting parameter, but
* cannot be overridden by user interaction with the table. What this means
* is that you could have a column (visible or hidden) which the sorting will
* always be forced on first - any sorting after that (from the user) will
* then be performed as required. This can be useful for grouping rows
* together.
* @type array
* @default null
* @dtopt Option
*
* @example
* $(document).ready( function() {
* $('#example').dataTable( {
* "aaSortingFixed": [[0,'asc']]
* } );
* } )
*/
"aaSortingFixed": null,
/**
* This parameter allows you to readily specify the entries in the length drop
* down menu that DataTables shows when pagination is enabled. It can be
* either a 1D array of options which will be used for both the displayed
* option and the value, or a 2D array which will use the array in the first
* position as the value, and the array in the second position as the
* displayed options (useful for language strings such as 'All').
* @type array
* @default [ 10, 25, 50, 100 ]
* @dtopt Option
*
* @example
* $(document).ready(function() {
* $('#example').dataTable( {
* "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
* } );
* } );
*
* @example
* // Setting the default display length as well as length menu
* // This is likely to be wanted if you remove the '10' option which
* // is the iDisplayLength default.
* $(document).ready(function() {
* $('#example').dataTable( {
* "iDisplayLength": 25,
* "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]]
* } );
* } );
*/
"aLengthMenu": [ 10, 25, 50, 100 ],
/**
* The aoColumns option in the initialisation parameter allows you to define
* details about the way individual columns behave. For a full list of
* column options that can be set, please see
* {@link DataTable.defaults.columns}. Note that if you use aoColumns to
* define your columns, you must have an entry in the array for every single
* column that you have in your table (these can be null if you don't which
* to specify any options).
* @member
*/
"aoColumns": null,
/**
* Very similar to aoColumns, aoColumnDefs allows you to target a specific
* column, multiple columns, or all columns, using the aTargets property of
* each object in the array. This allows great flexibility when creating
* tables, as the aoColumnDefs arrays can be of any length, targeting the
* columns you specifically want. aoColumnDefs may use any of the column
* options available: {@link DataTable.defaults.columns}, but it _must_
* have aTargets defined in each object in the array. Values in the aTargets
* array may be:
*