Namespace: oApi

Ancestry: DataTable# ยป oApi

DataTables v1.9.4 documentation

Navigation

Hiding private elements (toggle)
Showing extended elements (toggle)

Reference to internal functions for use by plug-in developers. Note that these methods are references to internal functions and are considered to be private. If you use these methods, be aware that they are liable to change between versions (check the upgrade notes).

Summary

Properties - static

<static> _fnJsonString

JSON stringify. If JSON.stringify it provided by the browser, json2.js or any other library, then we use that as it is fast, safe and accurate. If the function isn't available then we need to built it ourselves - the inspiration for this function comes from Craig Buckler ( http://www.sitepoint.com/javascript-json-serialization/ ). It is not perfect and absolutely should not be used as a replacement to json2.js - but it does do what we need, without requiring a dependency for DataTables.

Methods - static

<static> _fnAddColumn(oSettings, nTh)

Add a column to the list used for the table with default values

<static> _fnAddData(oSettings, aData) → {int}

Add a data array to the table, creating DOM node etc. This is the parallel to _fnGatherData, but for adding rows from a Javascript source, rather than a DOM source.

<static> _fnAddOptionsHtml(oSettings)

Add the options to the page HTML for the table

<static> _fnAdjustColumnSizing(oSettings)

Adjust the table column widths for new data. Note: you would probably want to do a redraw after calling this function!

<static> _fnAjaxParameters(oSettings) → {bool}

Build up the parameters in an object needed for a server-side processing request

<static> _fnAjaxUpdate(oSettings) → {boolean}

Update the table using an Ajax call

<static> _fnAjaxUpdateDraw(oSettings, json)

Data the data from the server (nuking the old) and redraw the table

<static> _fnApplyColumnDefs(oSettings, aoColDefs, aoCols, fn)

Take the column definitions and static columns arrays and calculate how they relate to column indexes. The callback function will then apply the definition found for a column to a suitable configuration object.

<static> _fnApplyToChildren(fn, array, array)

Apply a given function to the display child nodes of an element array (typically TD children of TR rows

<static> _fnBindAction(n, oData, fn)

Bind an event handers to allow a click or return key to activate the callback. This is good for accessibility since a return on the keyboard will have the same effect as a click, if the element has focus.

<static> _fnBrowserDetect(oSettings)

From some browsers (specifically IE6/7) we need special handling to work around browser bugs - this function is used to detect when these workarounds are needed.

<static> _fnBuildHead(oSettings)

Create the HTML header for the table

<static> _fnBuildSearchArray(oSettings, iMaster)

Create an array which can be quickly search through

<static> _fnBuildSearchRow(oSettings, aData)

Create a searchable string from a single data row

<static> _fnCalculateColumnWidths(oSettings)

Calculate the width of columns for the table

<static> _fnCalculateEnd(oSettings)

Recalculate the end point based on the start point

<static> _fnCallbackFire(oSettings, sStore, sTrigger, aArgs)

Fire callback functions and trigger events. Note that the loop over the callback array store is done backwards! Further note that you do not want to fire off triggers in time sensitive applications (for example cell creation) as its slow.

<static> _fnCallbackReg(oSettings, sStore, fn, sName)

Register a callback function. Easily allows a callback function to be added to an array store of callback functions that can then all be called together.

<static> _fnClearTable(oSettings)

Nuke the table

<static> _fnColumnIndexToVisible(iMatch, oSettings) → {int}

Covert the index of an index in the data array and convert it to the visible column index (take account of hidden columns)

<static> _fnColumnOptions(oSettings, iCol, oOptions)

Apply options for a column

<static> _fnColumnOrdering(oSettings) → {string}

Get the column ordering that DataTables expects

<static> _fnConvertToWidth(sWidth, nParent) → {int}

Convert a CSS unit width to pixels (e.g. 2em)

<static> _fnCreateCookie(sName, sValue, iSecs, sBaseName, fnCallback)

Create a new cookie with a value to store the state of a table

<static> _fnCreateTr(oSettings, iRow)

Create a new TR element (and it's TD children) for a row

<static> _fnDataToSearch(sData, sType) → {string}

Convert raw data into something that the user can search on

<static> _fnDeleteIndex(a, iTarget)

Take an array of integers (index array) and remove a target integer (value - not the key!)

<static> _fnDetectHeader(array, nThead)

Use the DOM source to create up an array of header cells. The idea here is to create a layout grid (array) of rows x columns, which contains a reference to the cell that that point in the grid (regardless of col/rowspan), such that any column / row could be removed and the new grid constructed

<static> _fnDetectType(sData) → {string}

Get the sort type based on an input string

<static> _fnDraw(oSettings)

Insert the required TR nodes into the table for display

<static> _fnDrawHead(oSettings, array, bIncludeHidden)

Draw the header (or footer) element based on the column visibility states. The methodology here is to use the layout array from _fnDetectHeader, modified for the instantaneous column visibility, to construct the new layout. The grid is traversed over cell at a time in a rows x columns grid fashion, although each cell insert can cover multiple elements in the grid - which is tracks using the aApplied array. Cell inserts in the grid will only occur where there isn't already a cell in that position.

<static> _fnEscapeRegex(sVal) → {string}

scape a string such that it can be used in a regular expression

<static> _fnExtend(oOut, oExtender) → {object}

Extend objects - very similar to jQuery.extend, but deep copy objects, and shallow copy arrays. The reason we need to do this, is that we don't want to deep copy array init values (such as aaSorting) since the dev wouldn't be able to override them, but we do want to deep copy arrays.

<static> _fnExternApiFunc(sFunc) → {function}

Create a wrapper function for exporting an internal functions to an external API.

<static> _fnFeatureHtmlFilter(oSettings) → {node}

Generate the node required for filtering text

<static> _fnFeatureHtmlInfo(oSettings) → {node}

Generate the node required for the info display

<static> _fnFeatureHtmlLength(oSettings) → {node}

Generate the node required for user display length changing

<static> _fnFeatureHtmlPaginate(oSettings) → {node}

Generate the node required for default pagination

<static> _fnFeatureHtmlProcessing(oSettings) → {node}

Generate the node required for the processing node

<static> _fnFeatureHtmlTable(oSettings) → {node}

Add any control elements for the table - specifically scrolling

<static> _fnFilter(oSettings, sInput, iForce, bRegex, bSmart, bCaseInsensitive)

Filter the data table based on user input and draw the table

<static> _fnFilterColumn(oSettings, sInput, iColumn, bRegex, bSmart, bCaseInsensitive)

Filter the table on a per-column basis

<static> _fnFilterComplete(oSettings, oSearch, iForce)

Filter the table using both the global filter and column based filtering

<static> _fnFilterCreateSearch(sSearch, bRegex, bSmart, bCaseInsensitive) → {RegExp}

Build a regular expression object suitable for searching a table

<static> _fnFilterCustom(oSettings)

Apply custom filtering functions

<static> _fnGatherData(oSettings)

Read in the data from the target table from the DOM

<static> _fnGetCellData(oSettings, iRow, iCol, sSpecific) → {*}

Get the data for a given cell from the internal cache, taking into account data mapping

<static> _fnGetColumns(oSettings, sParam) → {array}

Get an array of column indexes that match a given property

<static> _fnGetDataMaster(oSettings)

Return an array with the full table data

<static> _fnGetMaxLenString(oSettings, iCol) → {string}

Get the maximum strlen for each data column

<static> _fnGetObjectDataFn(mSource) → {function}

Return a function that can be used to get data from a source object, taking into account the ability to use nested objects as a source

<static> _fnGetRowData(oSettings, iRow, sSpecific, aiColumns) → {array}

Get an array of data for a given row from the internal data cache

<static> _fnGetTdNodes(oSettings, iIndividualRow) → {array}

Return an flat array with all TD nodes for the table, or row

<static> _fnGetTrNodes(oSettings) → {array}

Return an array with the TR nodes for the table

<static> _fnGetUniqueThs(oSettings, nHeader, aLayout)

Get an array of unique th elements, one for each column

<static> _fnGetWidestNode(oSettings, iCol) → {node}

Get the widest node

<static> _fnInitComplete(oSettings, json)

Draw the table for the first time, adding all required features

<static> _fnInitialise(oSettings)

Draw the table for the first time, adding all required features

<static> _fnLanguageCompat(oSettings)

Language compatibility - when certain options are given, and others aren't, we need to duplicate the values over, in order to provide backwards compatibility with older language files.

<static> _fnLoadState(oSettings, oInit)

Attempt to load a saved table state from a cookie

<static> _fnLog(oSettings, iLevel, sMesg)

Log an error message

<static> _fnMap(oRet, oSrc, sName, sMappedName)

See if a property is defined on one object, if so assign it to the other object

<static> _fnNodeToColumnIndex(oSettings, iRow, n) → {int}

Take a TD element and convert it into a column data index (not the visible index)

<static> _fnNodeToDataIndex(oSettings, n) → {int}

Take a TR element and convert it to an index in aoData

<static> _fnPageChange(oSettings, mAction) → {bool}

Alter the display settings to change the page

<static> _fnProcessingDisplay(oSettings, bShow)

Display or hide the processing indicator

<static> _fnReadCookie(sName) → {string}

Read an old cookie to get a cookie with an old table state

<static> _fnReDraw(oSettings)

Redraw the table - taking account of the various features which are enabled

<static> _fnRender(oSettings, iRow, iCol) → {*}

Call the developer defined fnRender function for a given cell (row/column) with the required parameters and return the result.

<static> _fnReOrderIndex(oSettings)

Figure out how to reorder a display list

<static> _fnSaveState(oSettings)

Save the state of a table in a cookie such that the page can be reloaded

<static> _fnScrollBarWidth() → {int}

Get the width of a scroll bar in this browser being used

<static> _fnScrollDraw(o) → {node}

Update the various tables for resizing. 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

<static> _fnScrollingWidthAdjust(oSettings, n)

Adjust a table's width to take account of scrolling

<static> _fnServerParams(oSettings, array)

Add Ajax parameters from plug-ins

<static> _fnSetCellData(oSettings, iRow, iCol, val)

Set the value for a specific cell, into the internal data cache

<static> _fnSetObjectDataFn(mSource) → {function}

Return a function that can be used to set data from a source object, taking into account the ability to use nested objects as a source

<static> _fnSettingsFromNode(nTable) → {object}

Return the settings object for a particular table

<static> _fnSort(oSettings, bApplyClasses)

Change the order of the table

<static> _fnSortAttachListener(oSettings, nNode, iDataIndex, fnCallback)

Attach a sort handler (click) to a node

<static> _fnSortingClasses(oSettings)

Set the sorting classes on the header, Note: it is safe to call this function when bSort and bSortClasses are false

<static> _fnStringToCss(aArray1, aArray2) → {int}

Append a CSS unit (only if required) to a string

<static> _fnUpdateInfo(oSettings)

Update the information elements in the display

<static> _fnVisbleColumns(oSettings) → {int}

Get the number of visible columns

<static> _fnVisibleToColumnIndex(oSettings, iMatch) → {int}

Covert the index of a visible column to the index in the data array (take account of hidden columns)

Details

Properties - static

<static> _fnJsonString

JSON stringify. If JSON.stringify it provided by the browser, json2.js or any other library, then we use that as it is fast, safe and accurate. If the function isn't available then we need to built it ourselves - the inspiration for this function comes from Craig Buckler ( http://www.sitepoint.com/javascript-json-serialization/ ). It is not perfect and absolutely should not be used as a replacement to json2.js - but it does do what we need, without requiring a dependency for DataTables.

Methods - static

<static> _fnAddColumn(oSettings, nTh)

Add a column to the list used for the table with default values

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
nThnode

The th element for this column

<static> _fnAddData(oSettings, aData) → {int}

Add a data array to the table, creating DOM node etc. This is the parallel to _fnGatherData, but for adding rows from a Javascript source, rather than a DOM source.

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
aDataarray

data array to be added

Returns:

=0 if successful (index of new aoData entry), -1 if failed

<static> _fnAddOptionsHtml(oSettings)

Add the options to the page HTML for the table

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnAdjustColumnSizing(oSettings)

Adjust the table column widths for new data. Note: you would probably want to do a redraw after calling this function!

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnAjaxParameters(oSettings) → {bool}

Build up the parameters in an object needed for a server-side processing request

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

block the table drawing or not

<static> _fnAjaxUpdate(oSettings) → {boolean}

Update the table using an Ajax call

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

Block the table drawing or not

<static> _fnAjaxUpdateDraw(oSettings, json)

Data the data from the server (nuking the old) and redraw the table

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
jsonobject

json data return from the server.

json.sEchostring

Tracking flag for DataTables to match requests

json.iTotalRecordsint

Number of records in the data set, not accounting for filtering

json.iTotalDisplayRecordsint

Number of records in the data set, accounting for filtering

json.aaDataarray

The data to display on this page

json.sColumnsstring<optional>

Column ordering (sName, comma separated)

<static> _fnApplyColumnDefs(oSettings, aoColDefs, aoCols, fn)

Take the column definitions and static columns arrays and calculate how they relate to column indexes. The callback function will then apply the definition found for a column to a suitable configuration object.

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
aoColDefsarray

The aoColumnDefs array that is to be applied

3
aoColsarray

The aoColumns array that defines columns individually

4
fnfunction

Callback function - takes two parameters, the calculated column index and the definition for that column.

<static> _fnApplyToChildren(fn, array, array)

Apply a given function to the display child nodes of an element array (typically TD children of TR rows

Parameters:
Name Type Attributes Default Description
1
fnfunction

Method to apply to the objects

2
array

{nodes} an1 List of elements to look through for display children

3
array

{nodes} an2 Another list (identical structure to the first) - optional

<static> _fnBindAction(n, oData, fn)

Bind an event handers to allow a click or return key to activate the callback. This is good for accessibility since a return on the keyboard will have the same effect as a click, if the element has focus.

Parameters:
Name Type Attributes Default Description
1
nelement

Element to bind the action to

2
oDataobject

Data object to pass to the triggered function

3
fnfunction

Callback function for when the event is triggered

<static> _fnBrowserDetect(oSettings)

From some browsers (specifically IE6/7) we need special handling to work around browser bugs - this function is used to detect when these workarounds are needed.

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnBuildHead(oSettings)

Create the HTML header for the table

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnBuildSearchArray(oSettings, iMaster)

Create an array which can be quickly search through

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iMasterint

use the master data array - optional

<static> _fnBuildSearchRow(oSettings, aData)

Create a searchable string from a single data row

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
aDataarray

Row data array to use for the data to search

<static> _fnCalculateColumnWidths(oSettings)

Calculate the width of columns for the table

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnCalculateEnd(oSettings)

Recalculate the end point based on the start point

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnCallbackFire(oSettings, sStore, sTrigger, aArgs)

Fire callback functions and trigger events. Note that the loop over the callback array store is done backwards! Further note that you do not want to fire off triggers in time sensitive applications (for example cell creation) as its slow.

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
sStorestring

Name of the array storage for the callbacks in oSettings

3
sTriggerstring

Name of the jQuery custom event to trigger. If null no trigger is fired

4
aArgsarray

Array of arguments to pass to the callback function / trigger

<static> _fnCallbackReg(oSettings, sStore, fn, sName)

Register a callback function. Easily allows a callback function to be added to an array store of callback functions that can then all be called together.

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
sStorestring

Name of the array storage for the callbacks in oSettings

3
fnfunction

Function to be called back

4
sNamestring

Identifying name for the callback (i.e. a label)

<static> _fnClearTable(oSettings)

Nuke the table

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnColumnIndexToVisible(iMatch, oSettings) → {int}

Covert the index of an index in the data array and convert it to the visible column index (take account of hidden columns)

Parameters:
Name Type Attributes Default Description
1
iMatchint

Column index to lookup

2
oSettingsobject

dataTables settings object

Returns:

i the data index

<static> _fnColumnOptions(oSettings, iCol, oOptions)

Apply options for a column

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iColint

column index to consider

3
oOptionsobject

object with sType, bVisible and bSearchable etc

<static> _fnColumnOrdering(oSettings) → {string}

Get the column ordering that DataTables expects

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

comma separated list of names

<static> _fnConvertToWidth(sWidth, nParent) → {int}

Convert a CSS unit width to pixels (e.g. 2em)

Parameters:
Name Type Attributes Default Description
1
sWidthstring

width to be converted

2
nParentnode

parent to get the with for (required for relative widths) - optional

Returns:

iWidth width in pixels

<static> _fnCreateCookie(sName, sValue, iSecs, sBaseName, fnCallback)

Create a new cookie with a value to store the state of a table

Parameters:
Name Type Attributes Default Description
1
sNamestring

name of the cookie to create

2
sValuestring

the value the cookie should take

3
iSecsint

duration of the cookie

4
sBaseNamestring

sName is made up of the base + file name - this is the base

5
fnCallbackfunction

User definable function to modify the cookie

<static> _fnCreateTr(oSettings, iRow)

Create a new TR element (and it's TD children) for a row

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iRowint

Row to consider

<static> _fnDataToSearch(sData, sType) → {string}

Convert raw data into something that the user can search on

Parameters:
Name Type Attributes Default Description
1
sDatastring

data to be modified

2
sTypestring

data type

Returns:

search string

<static> _fnDeleteIndex(a, iTarget)

Take an array of integers (index array) and remove a target integer (value - not the key!)

Parameters:
Name Type Attributes Default Description
1
aarray

Index array to target

2
iTargetint

value to find

<static> _fnDetectHeader(array, nThead)

Use the DOM source to create up an array of header cells. The idea here is to create a layout grid (array) of rows x columns, which contains a reference to the cell that that point in the grid (regardless of col/rowspan), such that any column / row could be removed and the new grid constructed

Parameters:
Name Type Attributes Default Description
1
array

{object} aLayout Array to store the calculated layout in

2
nTheadnode

The header/footer element for the table

<static> _fnDetectType(sData) → {string}

Get the sort type based on an input string

Parameters:
Name Type Attributes Default Description
1
sDatastring

data we wish to know the type of

Returns:

type (defaults to 'string' if no type can be detected)

<static> _fnDraw(oSettings)

Insert the required TR nodes into the table for display

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnDrawHead(oSettings, array, bIncludeHidden)

Draw the header (or footer) element based on the column visibility states. The methodology here is to use the layout array from _fnDetectHeader, modified for the instantaneous column visibility, to construct the new layout. The grid is traversed over cell at a time in a rows x columns grid fashion, although each cell insert can cover multiple elements in the grid - which is tracks using the aApplied array. Cell inserts in the grid will only occur where there isn't already a cell in that position.

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
array

{objects} aoSource Layout array from _fnDetectHeader

3
bIncludeHiddenbooleanOptionalfalse

If true then include the hidden columns in the calc,

<static> _fnEscapeRegex(sVal) → {string}

scape a string such that it can be used in a regular expression

Parameters:
Name Type Attributes Default Description
1
sValstring

string to escape

Returns:

escaped string

<static> _fnExtend(oOut, oExtender) → {object}

Extend objects - very similar to jQuery.extend, but deep copy objects, and shallow copy arrays. The reason we need to do this, is that we don't want to deep copy array init values (such as aaSorting) since the dev wouldn't be able to override them, but we do want to deep copy arrays.

Parameters:
Name Type Attributes Default Description
1
oOutobject

Object to extend

2
oExtenderobject

Object from which the properties will be applied to oOut

Returns:

oOut Reference, just for convenience - oOut === the return.

<static> _fnExternApiFunc(sFunc) → {function}

Create a wrapper function for exporting an internal functions to an external API.

Parameters:
Name Type Attributes Default Description
1
sFuncstring

API function name

Returns:

wrapped function

<static> _fnFeatureHtmlFilter(oSettings) → {node}

Generate the node required for filtering text

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

Filter control element

<static> _fnFeatureHtmlInfo(oSettings) → {node}

Generate the node required for the info display

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

Information element

<static> _fnFeatureHtmlLength(oSettings) → {node}

Generate the node required for user display length changing

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

Display length feature node

<static> _fnFeatureHtmlPaginate(oSettings) → {node}

Generate the node required for default pagination

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

Pagination feature node

<static> _fnFeatureHtmlProcessing(oSettings) → {node}

Generate the node required for the processing node

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

Processing element

<static> _fnFeatureHtmlTable(oSettings) → {node}

Add any control elements for the table - specifically scrolling

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

Node to add to the DOM

<static> _fnFilter(oSettings, sInput, iForce, bRegex, bSmart, bCaseInsensitive)

Filter the data table based on user input and draw the table

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
sInputstring

string to filter on

3
iForceint

optional - force a research of the master array (1) or not (undefined or 0)

4
bRegexbool

treat as a regular expression or not

5
bSmartbool

perform smart filtering or not

6
bCaseInsensitivebool

Do case insenstive matching or not

<static> _fnFilterColumn(oSettings, sInput, iColumn, bRegex, bSmart, bCaseInsensitive)

Filter the table on a per-column basis

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
sInputstring

string to filter on

3
iColumnint

column to filter

4
bRegexbool

treat search string as a regular expression or not

5
bSmartbool

use smart filtering or not

6
bCaseInsensitivebool

Do case insenstive matching or not

<static> _fnFilterComplete(oSettings, oSearch, iForce)

Filter the table using both the global filter and column based filtering

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
oSearchobject

search information

3
iForceintOptional

force a research of the master array (1) or not (undefined or 0)

<static> _fnFilterCreateSearch(sSearch, bRegex, bSmart, bCaseInsensitive) → {RegExp}

Build a regular expression object suitable for searching a table

Parameters:
Name Type Attributes Default Description
1
sSearchstring

string to search for

2
bRegexbool

treat as a regular expression or not

3
bSmartbool

perform smart filtering or not

4
bCaseInsensitivebool

Do case insensitive matching or not

Returns:

constructed object

<static> _fnFilterCustom(oSettings)

Apply custom filtering functions

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnGatherData(oSettings)

Read in the data from the target table from the DOM

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnGetCellData(oSettings, iRow, iCol, sSpecific) → {*}

Get the data for a given cell from the internal cache, taking into account data mapping

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iRowint

aoData row id

3
iColint

Column index

4
sSpecificstring

data get type ('display', 'type' 'filter' 'sort')

Returns:

Cell data

<static> _fnGetColumns(oSettings, sParam) → {array}

Get an array of column indexes that match a given property

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
sParamstring

Parameter in aoColumns to look for - typically bVisible or bSearchable

Returns:

Array of indexes with matched properties

<static> _fnGetDataMaster(oSettings)

Return an array with the full table data

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

array {array} aData Master data array

<static> _fnGetMaxLenString(oSettings, iCol) → {string}

Get the maximum strlen for each data column

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iColint

column of interest

Returns:

max string length for each column

<static> _fnGetObjectDataFn(mSource) → {function}

Return a function that can be used to get data from a source object, taking into account the ability to use nested objects as a source

Parameters:
Name Type Attributes Default Description
1
mSourcestring | int | function

The data source for the object

Returns:

Data get function

<static> _fnGetRowData(oSettings, iRow, sSpecific, aiColumns) → {array}

Get an array of data for a given row from the internal data cache

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iRowint

aoData row id

3
sSpecificstring

data get type ('type' 'filter' 'sort')

4
aiColumnsarray

Array of column indexes to get data from

Returns:

Data array

<static> _fnGetTdNodes(oSettings, iIndividualRow) → {array}

Return an flat array with all TD nodes for the table, or row

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iIndividualRowintOptional

aoData index to get the nodes for - optional if not given then the return array will contain all nodes for the table

Returns:

TD array

<static> _fnGetTrNodes(oSettings) → {array}

Return an array with the TR nodes for the table

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

TR array

<static> _fnGetUniqueThs(oSettings, nHeader, aLayout)

Get an array of unique th elements, one for each column

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
nHeadernode

automatically detect the layout from this node - optional

3
aLayoutarray

thead/tfoot layout from _fnDetectHeader - optional

Returns:

array {node} aReturn list of unique th's

<static> _fnGetWidestNode(oSettings, iCol) → {node}

Get the widest node

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iColint

column of interest

Returns:

widest table node

<static> _fnInitComplete(oSettings, json)

Draw the table for the first time, adding all required features

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
jsonobjectOptional

JSON from the server that completed the table, if using Ajax source with client-side processing (optional)

<static> _fnInitialise(oSettings)

Draw the table for the first time, adding all required features

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnLanguageCompat(oSettings)

Language compatibility - when certain options are given, and others aren't, we need to duplicate the values over, in order to provide backwards compatibility with older language files.

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnLoadState(oSettings, oInit)

Attempt to load a saved table state from a cookie

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
oInitobject

DataTables init object so we can override settings

<static> _fnLog(oSettings, iLevel, sMesg)

Log an error message

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iLevelint

log error messages, or display them to the user

3
sMesgstring

error message

<static> _fnMap(oRet, oSrc, sName, sMappedName)

See if a property is defined on one object, if so assign it to the other object

Parameters:
Name Type Attributes Default Description
1
oRetobject

target object

2
oSrcobject

source object

3
sNamestring

property

4
sMappedNamestringOptional

name to map too - optional, sName used if not given

<static> _fnNodeToColumnIndex(oSettings, iRow, n) → {int}

Take a TD element and convert it into a column data index (not the visible index)

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iRowint

The row number the TD/TH can be found in

3
nnode

The TD/TH element to find

Returns:

index if the node is found, -1 if not

<static> _fnNodeToDataIndex(oSettings, n) → {int}

Take a TR element and convert it to an index in aoData

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
nnode

the TR element to find

Returns:

index if the node is found, null if not

<static> _fnPageChange(oSettings, mAction) → {bool}

Alter the display settings to change the page

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
mActionstring | int

Paging action to take: "first", "previous", "next" or "last" or page number to jump to (integer)

Returns:

true page has changed, false - no change (no effect) eg 'first' on page 1

<static> _fnProcessingDisplay(oSettings, bShow)

Display or hide the processing indicator

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
bShowbool

Show the processing indicator (true) or not (false)

<static> _fnReadCookie(sName) → {string}

Read an old cookie to get a cookie with an old table state

Parameters:
Name Type Attributes Default Description
1
sNamestring

name of the cookie to read

Returns:

contents of the cookie - or null if no cookie with that name found

<static> _fnReDraw(oSettings)

Redraw the table - taking account of the various features which are enabled

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnRender(oSettings, iRow, iCol) → {*}

Call the developer defined fnRender function for a given cell (row/column) with the required parameters and return the result.

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iRowint

aoData index for the row

3
iColint

aoColumns index for the column

Returns:

Return of the developer's fnRender function

<static> _fnReOrderIndex(oSettings)

Figure out how to reorder a display list

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

array {int} aiReturn index list for reordering

<static> _fnSaveState(oSettings)

Save the state of a table in a cookie such that the page can be reloaded

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnScrollBarWidth() → {int}

Get the width of a scroll bar in this browser being used

Returns:

width in pixels

<static> _fnScrollDraw(o) → {node}

Update the various tables for resizing. 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

Parameters:
Name Type Attributes Default Description
1
oobject

dataTables settings object

Returns:

Node to add to the DOM

<static> _fnScrollingWidthAdjust(oSettings, n)

Adjust a table's width to take account of scrolling

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
nnode

table node

<static> _fnServerParams(oSettings, array)

Add Ajax parameters from plug-ins

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
array

{objects} aoData name/value pairs to send to the server

<static> _fnSetCellData(oSettings, iRow, iCol, val)

Set the value for a specific cell, into the internal data cache

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iRowint

aoData row id

3
iColint

Column index

4
val*

Value to set

<static> _fnSetObjectDataFn(mSource) → {function}

Return a function that can be used to set data from a source object, taking into account the ability to use nested objects as a source

Parameters:
Name Type Attributes Default Description
1
mSourcestring | int | function

The data source for the object

Returns:

Data set function

<static> _fnSettingsFromNode(nTable) → {object}

Return the settings object for a particular table

Parameters:
Name Type Attributes Default Description
1
nTablenode

table we are using as a dataTable

Returns:

Settings object - or null if not found

<static> _fnSort(oSettings, bApplyClasses)

Change the order of the table

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
bApplyClassesbool

optional - should we apply classes or not

<static> _fnSortAttachListener(oSettings, nNode, iDataIndex, fnCallback)

Attach a sort handler (click) to a node

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
nNodenode

node to attach the handler to

3
iDataIndexint

column sorting index

4
fnCallbackfunctionOptional

callback function

<static> _fnSortingClasses(oSettings)

Set the sorting classes on the header, Note: it is safe to call this function when bSort and bSortClasses are false

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnStringToCss(aArray1, aArray2) → {int}

Append a CSS unit (only if required) to a string

Parameters:
Name Type Attributes Default Description
1
aArray1array

first array

2
aArray2array

second array

Returns:

0 if match, 1 if length is different, 2 if no match

<static> _fnUpdateInfo(oSettings)

Update the information elements in the display

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

<static> _fnVisbleColumns(oSettings) → {int}

Get the number of visible columns

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

Returns:

i the number of visible columns

<static> _fnVisibleToColumnIndex(oSettings, iMatch) → {int}

Covert the index of a visible column to the index in the data array (take account of hidden columns)

Parameters:
Name Type Attributes Default Description
1
oSettingsobject

dataTables settings object

2
iMatchint

Visible column index to lookup

Returns:

i the data index