mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-30 23:52:11 +01:00
New: The primary public interface for DataTables' initialisation options is now camel case parameters rather than the Hungarian notation that was used before. There are a number of reasons for doing this, the primary one being that the Hungarian notation used by DataTables is actively stopping people from using the library due to their aversion to using Hungarian notation. Without doubt the Hungarian notation used was a mistake (the reason it was used was that when DataTables was originally written, the company I worked for at the time required the use of Hungarian notation, and thus I was trained in it...).
Backwards compatibility issues: The main goal here (other than to use camel-case notation!) is to preserve backwards compatibility. Unfortunately this isn't 100% possible: - DataTable.defaults.columns has been renamed to be DataTable.defaults.column - Otherwise it conflicts with aoColumns in the defaults. Without doubt this is going to be a long process - for example the unit tests and examples need to be completely updated for this change. The JSDoc comments have been updated, so the site should take care of itself for the most part, when released. In terms of implementation, it is important to note that I have not broken backwards compatibility here - the way it is does is that the current defaults are retained, and a camel-case to Hungarian mapping is automatically generated and then applied to the objects given by the end user. This adds around 0.5K to the size of DataTables, but writing the mapping manually would require at least 3K, and changing DataTables wholesale to camel-case would utterly break backwards compatibility. This is the least 'evil' way to accomplish this. It is important to note that this is a step along the roadmap for DataTables - come v2 Hungarian notation will likely be dropped completely. One important note to make about this mapping is that if you use camel-case DataTables will copy the value from the camel-case properties to their Hungarian counterparts, so you will end up with additional properties on your source object. As I say, this appears to be to be the least 'evil' option, although still not perfect itself. The challenges of working with legacy software and installs...!
This commit is contained in:
parent
65cde4c612
commit
a0455fa858
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DataTables",
|
"name": "DataTables",
|
||||||
"version": "1.9.4",
|
"version": "1.10.0.dev",
|
||||||
"main": [
|
"main": [
|
||||||
"./media/js/jquery.dataTables.js",
|
"./media/js/jquery.dataTables.js",
|
||||||
"./media/css/jquery.dataTables.css",
|
"./media/css/jquery.dataTables.css",
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$.extend( $.fn.dataTable.defaults, {
|
$.extend( $.fn.dataTable.defaults, {
|
||||||
"bFilter": false,
|
"filter": false,
|
||||||
"bSort": false
|
"sort": false
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$('#example').dataTable();
|
$('#example').dataTable();
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#example').dataTable( {
|
$('#example').dataTable( {
|
||||||
"oLanguage": {
|
"language": {
|
||||||
"sUrl": "../examples_support/de_DE.txt"
|
"url": "../examples_support/de_DE.txt"
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#example').dataTable( {
|
$('#example').dataTable( {
|
||||||
"aoColumnDefs": [
|
"columnDefs": [
|
||||||
{ "bSearchable": false, "bVisible": false, "aTargets": [ 2 ] },
|
{ "searchable": false, "visible": false, "targets": [ 2 ] },
|
||||||
{ "bVisible": false, "aTargets": [ 3 ] }
|
{ "visible": false, "targets": [ 3 ] }
|
||||||
] } );
|
] } );
|
||||||
} );
|
} );
|
||||||
</script>
|
</script>
|
||||||
|
@ -14,12 +14,12 @@
|
|||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#example').dataTable( {
|
$('#example').dataTable( {
|
||||||
"oLanguage": {
|
"language": {
|
||||||
"sLengthMenu": "Display _MENU_ records per page",
|
"lengthMenu": "Display _MENU_ records per page",
|
||||||
"sZeroRecords": "Nothing found - sorry",
|
"zeroRecords": "Nothing found - sorry",
|
||||||
"sInfo": "Showing _START_ to _END_ of _TOTAL_ records",
|
"info": "Showing _START_ to _END_ of _TOTAL_ records",
|
||||||
"sInfoEmpty": "Showing 0 to 0 of 0 records",
|
"infoEmpty": "Showing 0 to 0 of 0 records",
|
||||||
"sInfoFiltered": "(filtered from _MAX_ total records)"
|
"infoFiltered": "(filtered from _MAX_ total records)"
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
@ -463,7 +463,7 @@
|
|||||||
|
|
||||||
<h1>Initialisation code</h1>
|
<h1>Initialisation code</h1>
|
||||||
<pre class="brush: js;">$(document).ready(function() {
|
<pre class="brush: js;">$(document).ready(function() {
|
||||||
$('#example').dataTable( {
|
$('#example').dataTable( {
|
||||||
"oLanguage": {
|
"oLanguage": {
|
||||||
"sLengthMenu": "Display _MENU_ records per page",
|
"sLengthMenu": "Display _MENU_ records per page",
|
||||||
"sZeroRecords": "Nothing found - sorry",
|
"sZeroRecords": "Nothing found - sorry",
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
oTable = $('#example').dataTable({
|
oTable = $('#example').dataTable({
|
||||||
"bJQueryUI": true,
|
"jQueryUI": true,
|
||||||
"sPaginationType": "full_numbers"
|
"paginationType": "full_numbers"
|
||||||
});
|
});
|
||||||
} );
|
} );
|
||||||
</script>
|
</script>
|
||||||
|
@ -13,7 +13,9 @@
|
|||||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
|
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#example').dataTable();
|
$('#example').dataTable( {
|
||||||
|
bSort: false
|
||||||
|
} );
|
||||||
} );
|
} );
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
{
|
{
|
||||||
"sProcessing": "Bitte warten...",
|
"processing": "Bitte warten...",
|
||||||
"sLengthMenu": "_MENU_ Einträge anzeigen",
|
"lengthMenu": "_MENU_ Einträge anzeigen",
|
||||||
"sZeroRecords": "Keine Einträge vorhanden.",
|
"zeroRecords": "Keine Einträge vorhanden.",
|
||||||
"sInfo": "_START_ bis _END_ von _TOTAL_ Einträgen",
|
"info": "_START_ bis _END_ von _TOTAL_ Einträgen",
|
||||||
"sInfoEmpty": "0 bis 0 von 0 Einträgen",
|
"infoEmpty": "0 bis 0 von 0 Einträgen",
|
||||||
"sInfoFiltered": "(gefiltert von _MAX_ Einträgen)",
|
"infoFiltered": "(gefiltert von _MAX_ Einträgen)",
|
||||||
"sInfoPostFix": "",
|
"infoPostFix": "",
|
||||||
"sSearch": "Suchen",
|
"search": "Suchen",
|
||||||
"sUrl": "",
|
"url": "",
|
||||||
"oPaginate": {
|
"paginate": {
|
||||||
"sFirst": "Erster",
|
"first": "Erster",
|
||||||
"sPrevious": "Zurück",
|
"previous": "Zurück",
|
||||||
"sNext": "Nächster",
|
"next": "Nächster",
|
||||||
"sLast": "Letzter"
|
"last": "Letzter"
|
||||||
}
|
}
|
||||||
}
|
}
|
1421
media/js/jquery.dataTables.js
vendored
1421
media/js/jquery.dataTables.js
vendored
@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*jslint evil: true, undef: true, browser: true */
|
/*jslint evil: true, undef: true, browser: true */
|
||||||
/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns*/
|
/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns,_fnHungarianMap,_fnCamelToHungarian*/
|
||||||
|
|
||||||
(/** @lends <global> */function( window, document, undefined ) {
|
(/** @lends <global> */function( window, document, undefined ) {
|
||||||
|
|
||||||
@ -43,6 +43,108 @@
|
|||||||
}
|
}
|
||||||
(/** @lends <global> */function( $ ) {
|
(/** @lends <global> */function( $ ) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a mapping object that allows camel case parameters to be looked up
|
||||||
|
* for their Hungarian counterparts. The mapping is stored in a private
|
||||||
|
* parameter called `_hungaianMap` which can be accessed on the source object.
|
||||||
|
* @param {object} o
|
||||||
|
* @memberof DataTable#oApi
|
||||||
|
*/
|
||||||
|
function _fnHungarianMap ( o )
|
||||||
|
{
|
||||||
|
var
|
||||||
|
hungarian = 'a aa ao as b fn i m o s ',
|
||||||
|
match,
|
||||||
|
newKey,
|
||||||
|
map = {};
|
||||||
|
|
||||||
|
$.each( o, function (key, val) {
|
||||||
|
match = key.match(/^([^A-Z]+?)([A-Z])/);
|
||||||
|
|
||||||
|
if ( match && hungarian.indexOf(match[1]+' ') !== -1 )
|
||||||
|
{
|
||||||
|
newKey = key.replace( match[0], match[2].toLowerCase() );
|
||||||
|
map[ newKey ] = key;
|
||||||
|
|
||||||
|
if ( match[1] === 'o' )
|
||||||
|
{
|
||||||
|
_fnHungarianMap( o[key] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
o._hungaianMap = map;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert from camel case parameters to Hungarian, based on a Hungarian map
|
||||||
|
* created by _fnHungarianMap.
|
||||||
|
* @param {object} src The model object which holds all parameters can has
|
||||||
|
* previously been run through `_fnHungarianMap`.
|
||||||
|
* @param {object} user The object to convert from camel case to Hungarian.
|
||||||
|
* @param {boolean} force When set to `true`, properties which already have a
|
||||||
|
* Hungarian value in the `user` object will be overwritten. Otherwise they
|
||||||
|
* won't be.
|
||||||
|
* @memberof DataTable#oApi
|
||||||
|
*/
|
||||||
|
function _fnCamelToHungarian ( src, user, force )
|
||||||
|
{
|
||||||
|
if ( ! src._hungaianMap )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hungarianKey;
|
||||||
|
|
||||||
|
$.each( user, function (key, val) {
|
||||||
|
hungarianKey = src._hungaianMap[ key ];
|
||||||
|
|
||||||
|
if ( hungarianKey !== undefined && (force || user[hungarianKey] === undefined) )
|
||||||
|
{
|
||||||
|
user[hungarianKey] = user[ key ];
|
||||||
|
|
||||||
|
if ( hungarianKey.charAt(0) === 'o' )
|
||||||
|
{
|
||||||
|
_fnCamelToHungarian( src[hungarianKey], user[key] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
* @param {object} oSettings dataTables settings object
|
||||||
|
* @memberof DataTable#oApi
|
||||||
|
*/
|
||||||
|
function _fnLanguageCompat( oLanguage )
|
||||||
|
{
|
||||||
|
var oDefaults = DataTable.defaults.oLanguage;
|
||||||
|
|
||||||
|
/* Backwards compatibility - if there is no sEmptyTable given, then use the same as
|
||||||
|
* sZeroRecords - assuming that is given.
|
||||||
|
*/
|
||||||
|
if ( !oLanguage.sEmptyTable && oLanguage.sZeroRecords &&
|
||||||
|
oDefaults.sEmptyTable === "No data available in table" )
|
||||||
|
{
|
||||||
|
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sEmptyTable' );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Likewise with loading records */
|
||||||
|
if ( !oLanguage.sLoadingRecords && oLanguage.sZeroRecords &&
|
||||||
|
oDefaults.sLoadingRecords === "Loading..." )
|
||||||
|
{
|
||||||
|
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sLoadingRecords' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DataTables is a plug-in for the jQuery Javascript library. It is a
|
* DataTables is a plug-in for the jQuery Javascript library. It is a
|
||||||
* highly flexible tool, based upon the foundations of progressive
|
* highly flexible tool, based upon the foundations of progressive
|
||||||
@ -87,7 +189,7 @@
|
|||||||
*/
|
*/
|
||||||
function _fnAddColumn( oSettings, nTh )
|
function _fnAddColumn( oSettings, nTh )
|
||||||
{
|
{
|
||||||
var oDefaults = DataTable.defaults.columns;
|
var oDefaults = DataTable.defaults.column;
|
||||||
var iCol = oSettings.aoColumns.length;
|
var iCol = oSettings.aoColumns.length;
|
||||||
var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {
|
var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {
|
||||||
"sSortingClass": oSettings.oClasses.sSortable,
|
"sSortingClass": oSettings.oClasses.sSortable,
|
||||||
@ -144,6 +246,9 @@
|
|||||||
/* User specified column options */
|
/* User specified column options */
|
||||||
if ( oOptions !== undefined && oOptions !== null )
|
if ( oOptions !== undefined && oOptions !== null )
|
||||||
{
|
{
|
||||||
|
// Map camel case parameters to their Hungarian counterparts
|
||||||
|
_fnCamelToHungarian( DataTable.defaults.column, oOptions );
|
||||||
|
|
||||||
/* Backwards compatibility for mDataProp */
|
/* Backwards compatibility for mDataProp */
|
||||||
if ( oOptions.mDataProp && !oOptions.mData )
|
if ( oOptions.mDataProp && !oOptions.mData )
|
||||||
{
|
{
|
||||||
@ -373,8 +478,8 @@
|
|||||||
for ( i=aoColDefs.length-1 ; i>=0 ; i-- )
|
for ( i=aoColDefs.length-1 ; i>=0 ; i-- )
|
||||||
{
|
{
|
||||||
/* Each definition can target multiple columns, as it is an array */
|
/* Each definition can target multiple columns, as it is an array */
|
||||||
var aTargets = aoColDefs[i].aTargets;
|
var aTargets = aoColDefs[i].targets || aoColDefs[i].aTargets;
|
||||||
if ( !$.isArray( aTargets ) )
|
if ( ! $.isArray( aTargets ) )
|
||||||
{
|
{
|
||||||
_fnLog( oSettings, 1, 'aTargets must be an array of targets, not a '+(typeof aTargets) );
|
_fnLog( oSettings, 1, 'aTargets must be an array of targets, not a '+(typeof aTargets) );
|
||||||
}
|
}
|
||||||
@ -1796,7 +1901,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the table using an Ajax call
|
* Update the table using an Ajax call
|
||||||
* @param {object} oSettings dataTables settings object
|
* @param {object} oSettings dataTables settings object
|
||||||
@ -1936,8 +2040,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !oSettings.oScroll.bInfinite ||
|
if ( !oSettings.oScroll.bInfinite || oSettings.bSorted || oSettings.bFiltered )
|
||||||
(oSettings.oScroll.bInfinite && (oSettings.bSorted || oSettings.bFiltered)) )
|
|
||||||
{
|
{
|
||||||
_fnClearTable( oSettings );
|
_fnClearTable( oSettings );
|
||||||
}
|
}
|
||||||
@ -1947,21 +2050,7 @@
|
|||||||
var aData = _fnGetObjectDataFn( oSettings.sAjaxDataProp )( json );
|
var aData = _fnGetObjectDataFn( oSettings.sAjaxDataProp )( json );
|
||||||
for ( var i=0, iLen=aData.length ; i<iLen ; i++ )
|
for ( var i=0, iLen=aData.length ; i<iLen ; i++ )
|
||||||
{
|
{
|
||||||
if ( bReOrder )
|
_fnAddData( oSettings, aData[i] );
|
||||||
{
|
|
||||||
/* If we need to re-order, then create a new array with the correct order and add it */
|
|
||||||
var aDataSorted = [];
|
|
||||||
for ( var j=0, jLen=oSettings.aoColumns.length ; j<jLen ; j++ )
|
|
||||||
{
|
|
||||||
aDataSorted.push( aData[i][ aiIndex[j] ] );
|
|
||||||
}
|
|
||||||
_fnAddData( oSettings, aDataSorted );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* No re-order required, sever got it "right" - just straight add */
|
|
||||||
_fnAddData( oSettings, aData[i] );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
|
oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
|
||||||
|
|
||||||
@ -2606,35 +2695,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
* @param {object} oSettings dataTables settings object
|
|
||||||
* @memberof DataTable#oApi
|
|
||||||
*/
|
|
||||||
function _fnLanguageCompat( oLanguage )
|
|
||||||
{
|
|
||||||
var oDefaults = DataTable.defaults.oLanguage;
|
|
||||||
|
|
||||||
/* Backwards compatibility - if there is no sEmptyTable given, then use the same as
|
|
||||||
* sZeroRecords - assuming that is given.
|
|
||||||
*/
|
|
||||||
if ( !oLanguage.sEmptyTable && oLanguage.sZeroRecords &&
|
|
||||||
oDefaults.sEmptyTable === "No data available in table" )
|
|
||||||
{
|
|
||||||
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sEmptyTable' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Likewise with loading records */
|
|
||||||
if ( !oLanguage.sLoadingRecords && oLanguage.sZeroRecords &&
|
|
||||||
oDefaults.sLoadingRecords === "Loading..." )
|
|
||||||
{
|
|
||||||
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sLoadingRecords' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the node required for user display length changing
|
* Generate the node required for user display length changing
|
||||||
@ -6311,7 +6371,9 @@
|
|||||||
"_fnNodeToColumnIndex": _fnNodeToColumnIndex,
|
"_fnNodeToColumnIndex": _fnNodeToColumnIndex,
|
||||||
"_fnInfoMacros": _fnInfoMacros,
|
"_fnInfoMacros": _fnInfoMacros,
|
||||||
"_fnBrowserDetect": _fnBrowserDetect,
|
"_fnBrowserDetect": _fnBrowserDetect,
|
||||||
"_fnGetColumns": _fnGetColumns
|
"_fnGetColumns": _fnGetColumns,
|
||||||
|
"_fnHungarianMap": _fnHungarianMap,
|
||||||
|
"_fnCamelToHungarian": _fnCamelToHungarian
|
||||||
};
|
};
|
||||||
|
|
||||||
$.extend( DataTable.ext.oApi, this.oApi );
|
$.extend( DataTable.ext.oApi, this.oApi );
|
||||||
@ -6341,6 +6403,17 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Convert the camel-case defaults to Hungarian */
|
||||||
|
_fnCamelToHungarian( DataTable.defaults, DataTable.defaults, true );
|
||||||
|
_fnCamelToHungarian( DataTable.defaults.column, DataTable.defaults.column, true );
|
||||||
|
|
||||||
|
/* Setting up the initialisation object */
|
||||||
|
if ( !oInit )
|
||||||
|
{
|
||||||
|
oInit = {};
|
||||||
|
}
|
||||||
|
_fnCamelToHungarian( DataTable.defaults, oInit );
|
||||||
|
|
||||||
/* Check to see if we are re-initialising a table */
|
/* Check to see if we are re-initialising a table */
|
||||||
for ( i=0, iLen=DataTable.settings.length ; i<iLen ; i++ )
|
for ( i=0, iLen=DataTable.settings.length ; i<iLen ; i++ )
|
||||||
{
|
{
|
||||||
@ -6399,12 +6472,6 @@
|
|||||||
// to the settings array, so we can self reference the table instance if more than one
|
// to the settings array, so we can self reference the table instance if more than one
|
||||||
oSettings.oInstance = (_that.length===1) ? _that : $(this).dataTable();
|
oSettings.oInstance = (_that.length===1) ? _that : $(this).dataTable();
|
||||||
|
|
||||||
/* Setting up the initialisation object */
|
|
||||||
if ( !oInit )
|
|
||||||
{
|
|
||||||
oInit = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Backwards compatibility, before we apply all the defaults
|
// Backwards compatibility, before we apply all the defaults
|
||||||
if ( oInit.oLanguage )
|
if ( oInit.oLanguage )
|
||||||
{
|
{
|
||||||
@ -6544,6 +6611,7 @@
|
|||||||
oSettings.oLanguage.sUrl = oInit.oLanguage.sUrl;
|
oSettings.oLanguage.sUrl = oInit.oLanguage.sUrl;
|
||||||
$.getJSON( oSettings.oLanguage.sUrl, null, function( json ) {
|
$.getJSON( oSettings.oLanguage.sUrl, null, function( json ) {
|
||||||
_fnLanguageCompat( json );
|
_fnLanguageCompat( json );
|
||||||
|
_fnCamelToHungarian( DataTable.defaults.oLanguage, json );
|
||||||
$.extend( true, oSettings.oLanguage, oInit.oLanguage, json );
|
$.extend( true, oSettings.oLanguage, oInit.oLanguage, json );
|
||||||
_fnInitialise( oSettings );
|
_fnInitialise( oSettings );
|
||||||
} );
|
} );
|
||||||
@ -7528,7 +7596,7 @@
|
|||||||
* is held in the settings aoColumns array and contains all the information that
|
* is held in the settings aoColumns array and contains all the information that
|
||||||
* DataTables needs about each individual column.
|
* DataTables needs about each individual column.
|
||||||
*
|
*
|
||||||
* Note that this object is related to {@link DataTable.defaults.columns}
|
* Note that this object is related to {@link DataTable.defaults.column}
|
||||||
* but this one is the internal data store for DataTables's cache of 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
|
* It should NOT be manipulated outside of DataTables. Any configuration should
|
||||||
* be done through the initialisation options.
|
* be done through the initialisation options.
|
||||||
@ -7751,6 +7819,21 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Developer note: The properties of the object below are given in Hungarian
|
||||||
|
* notation, that was used as the interface for DataTables prior to v1.10, however
|
||||||
|
* from v1.10 onwards the primary interface is camel case. In order to avoid
|
||||||
|
* breaking backwards compatibility utterly with this change, the Hungarian
|
||||||
|
* version is still, internally the primary interface, but is is not documented
|
||||||
|
* - hence the @name tags in each doc comment. This allows a Javascript function
|
||||||
|
* to create a map from Hungarian notation to camel case (going the other direction
|
||||||
|
* would require each property to be listed, which would at around 3K to the size
|
||||||
|
* of DataTables, while this method is about a 0.5K hit.
|
||||||
|
*
|
||||||
|
* Ultimately this does pave the way for Hungarian notation to be dropped
|
||||||
|
* completely, but that is a massive amount of work and will break current
|
||||||
|
* installs (therefore is on-hold until v2).
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialisation options that can be given to DataTables at initialisation
|
* Initialisation options that can be given to DataTables at initialisation
|
||||||
@ -7765,31 +7848,33 @@
|
|||||||
* example with a custom Ajax call.
|
* example with a custom Ajax call.
|
||||||
* @type array
|
* @type array
|
||||||
* @default null
|
* @default null
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.data
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using a 2D array data source
|
* // Using a 2D array data source
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aaData": [
|
* "data": [
|
||||||
* ['Trident', 'Internet Explorer 4.0', 'Win 95+', 4, 'X'],
|
* ['Trident', 'Internet Explorer 4.0', 'Win 95+', 4, 'X'],
|
||||||
* ['Trident', 'Internet Explorer 5.0', 'Win 95+', 5, 'C'],
|
* ['Trident', 'Internet Explorer 5.0', 'Win 95+', 5, 'C'],
|
||||||
* ],
|
* ],
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sTitle": "Engine" },
|
* { "title": "Engine" },
|
||||||
* { "sTitle": "Browser" },
|
* { "title": "Browser" },
|
||||||
* { "sTitle": "Platform" },
|
* { "title": "Platform" },
|
||||||
* { "sTitle": "Version" },
|
* { "title": "Version" },
|
||||||
* { "sTitle": "Grade" }
|
* { "title": "Grade" }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using an array of objects as a data source (mData)
|
* // Using an array of objects as a data source (`data`)
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aaData": [
|
* "data": [
|
||||||
* {
|
* {
|
||||||
* "engine": "Trident",
|
* "engine": "Trident",
|
||||||
* "browser": "Internet Explorer 4.0",
|
* "browser": "Internet Explorer 4.0",
|
||||||
@ -7805,12 +7890,12 @@
|
|||||||
* "grade": "C"
|
* "grade": "C"
|
||||||
* }
|
* }
|
||||||
* ],
|
* ],
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sTitle": "Engine", "mData": "engine" },
|
* { "title": "Engine", "data": "engine" },
|
||||||
* { "sTitle": "Browser", "mData": "browser" },
|
* { "title": "Browser", "data": "browser" },
|
||||||
* { "sTitle": "Platform", "mData": "platform" },
|
* { "title": "Platform", "data": "platform" },
|
||||||
* { "sTitle": "Version", "mData": "version" },
|
* { "title": "Version", "data": "version" },
|
||||||
* { "sTitle": "Grade", "mData": "grade" }
|
* { "title": "Grade", "data": "grade" }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -7821,25 +7906,27 @@
|
|||||||
/**
|
/**
|
||||||
* If sorting is enabled, then DataTables will perform a first pass sort on
|
* 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,
|
* initialisation. You can define which column(s) the sort is performed upon,
|
||||||
* and the sorting direction, with this variable. The aaSorting array should
|
* and the sorting direction, with this variable. The `sorting` array should
|
||||||
* contain an array for each column to be sorted initially containing the
|
* contain an array for each column to be sorted initially containing the
|
||||||
* column's index and a direction string ('asc' or 'desc').
|
* column's index and a direction string ('asc' or 'desc').
|
||||||
* @type array
|
* @type array
|
||||||
* @default [[0,'asc']]
|
* @default [[0,'asc']]
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.sorting
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Sort by 3rd column first, and then 4th column
|
* // Sort by 3rd column first, and then 4th column
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aaSorting": [[2,'asc'], [3,'desc']]
|
* "sorting": [[2,'asc'], [3,'desc']]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* // No initial sorting
|
* // No initial sorting
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aaSorting": []
|
* "sorting": []
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -7847,7 +7934,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This parameter is basically identical to the aaSorting parameter, but
|
* This parameter is basically identical to the `sorting` parameter, but
|
||||||
* cannot be overridden by user interaction with the table. What this means
|
* 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
|
* 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
|
* always be forced on first - any sorting after that (from the user) will
|
||||||
@ -7855,12 +7942,14 @@
|
|||||||
* together.
|
* together.
|
||||||
* @type array
|
* @type array
|
||||||
* @default null
|
* @default null
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.sortingFixed
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aaSortingFixed": [[0,'asc']]
|
* "sortingFixed": [[0,'asc']]
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -7876,23 +7965,25 @@
|
|||||||
* displayed options (useful for language strings such as 'All').
|
* displayed options (useful for language strings such as 'All').
|
||||||
* @type array
|
* @type array
|
||||||
* @default [ 10, 25, 50, 100 ]
|
* @default [ 10, 25, 50, 100 ]
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.lengthMenu
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
|
* "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Setting the default display length as well as length menu
|
* // Setting the default display length as well as length menu
|
||||||
* // This is likely to be wanted if you remove the '10' option which
|
* // This is likely to be wanted if you remove the '10' option which
|
||||||
* // is the iDisplayLength default.
|
* // is the displayLength default.
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "iDisplayLength": 25,
|
* "displayLength": 25,
|
||||||
* "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]]
|
* "lengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -7900,25 +7991,27 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The aoColumns option in the initialisation parameter allows you to define
|
* The `columns` option in the initialisation parameter allows you to define
|
||||||
* details about the way individual columns behave. For a full list of
|
* details about the way individual columns behave. For a full list of
|
||||||
* column options that can be set, please see
|
* column options that can be set, please see
|
||||||
* {@link DataTable.defaults.columns}. Note that if you use aoColumns to
|
* {@link DataTable.defaults.column}. Note that if you use `columns` to
|
||||||
* define your columns, you must have an entry in the array for every single
|
* 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
|
* column that you have in your table (these can be null if you don't which
|
||||||
* to specify any options).
|
* to specify any options).
|
||||||
* @member
|
* @member
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column
|
||||||
*/
|
*/
|
||||||
"aoColumns": null,
|
"aoColumns": null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Very similar to aoColumns, aoColumnDefs allows you to target a specific
|
* Very similar to `columns`, `columnDefs` allows you to target a specific
|
||||||
* column, multiple columns, or all columns, using the aTargets property of
|
* column, multiple columns, or all columns, using the `targets` property of
|
||||||
* each object in the array. This allows great flexibility when creating
|
* each object in the array. This allows great flexibility when creating
|
||||||
* tables, as the aoColumnDefs arrays can be of any length, targeting the
|
* tables, as the `columnDefs` arrays can be of any length, targeting the
|
||||||
* columns you specifically want. aoColumnDefs may use any of the column
|
* columns you specifically want. `columnDefs` may use any of the column
|
||||||
* options available: {@link DataTable.defaults.columns}, but it _must_
|
* options available: {@link DataTable.defaults.column}, but it _must_
|
||||||
* have aTargets defined in each object in the array. Values in the aTargets
|
* have `targets` defined in each object in the array. Values in the `targets`
|
||||||
* array may be:
|
* array may be:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>a string - class name will be matched on the TH for the column</li>
|
* <li>a string - class name will be matched on the TH for the column</li>
|
||||||
@ -7927,28 +8020,32 @@
|
|||||||
* <li>the string "_all" - all columns (i.e. assign a default)</li>
|
* <li>the string "_all" - all columns (i.e. assign a default)</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* @member
|
* @member
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.columnDefs
|
||||||
*/
|
*/
|
||||||
"aoColumnDefs": null,
|
"aoColumnDefs": null,
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basically the same as oSearch, this parameter defines the individual column
|
* Basically the same as `search`, this parameter defines the individual column
|
||||||
* filtering state at initialisation time. The array must be of the same size
|
* filtering state at initialisation time. The array must be of the same size
|
||||||
* as the number of columns, and each element be an object with the parameters
|
* as the number of columns, and each element be an object with the parameters
|
||||||
* "sSearch" and "bEscapeRegex" (the latter is optional). 'null' is also
|
* `search` and `escapeRegex` (the latter is optional). 'null' is also
|
||||||
* accepted and the default will be used.
|
* accepted and the default will be used.
|
||||||
* @type array
|
* @type array
|
||||||
* @default []
|
* @default []
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.searchCols
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoSearchCols": [
|
* "searchCols": [
|
||||||
* null,
|
* null,
|
||||||
* { "sSearch": "My filter" },
|
* { "search": "My filter" },
|
||||||
* null,
|
* null,
|
||||||
* { "sSearch": "^[0-9]", "bEscapeRegex": false }
|
* { "search": "^[0-9]", "escapeRegex": false }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
@ -7961,14 +8058,16 @@
|
|||||||
* array may be of any length, and DataTables will apply each class
|
* array may be of any length, and DataTables will apply each class
|
||||||
* sequentially, looping when required.
|
* sequentially, looping when required.
|
||||||
* @type array
|
* @type array
|
||||||
* @default null <i>Will take the values determined by the oClasses.sStripe*
|
* @default null <i>Will take the values determined by the `oClasses.stripe*`
|
||||||
* options</i>
|
* options</i>
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.stripeClasses
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "asStripeClasses": [ 'strip1', 'strip2', 'strip3' ]
|
* "stripeClasses": [ 'strip1', 'strip2', 'strip3' ]
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -7978,15 +8077,17 @@
|
|||||||
/**
|
/**
|
||||||
* Enable or disable automatic column width calculation. This can be disabled
|
* Enable or disable automatic column width calculation. This can be disabled
|
||||||
* as an optimisation (it takes some time to calculate the widths) if the
|
* as an optimisation (it takes some time to calculate the widths) if the
|
||||||
* tables widths are passed in using aoColumns.
|
* tables widths are passed in using `columns`.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.autoWidth
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bAutoWidth": false
|
* "autoWidth": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8001,13 +8102,15 @@
|
|||||||
* time.
|
* time.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.deferRender
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sAjaxSource": "sources/arrays.txt",
|
* "ajaxSource": "sources/arrays.txt",
|
||||||
* "bDeferRender": true
|
* "deferRender": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8021,19 +8124,21 @@
|
|||||||
* per normal.
|
* per normal.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.destroy
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sScrollY": "200px",
|
* "srollY": "200px",
|
||||||
* "bPaginate": false
|
* "paginate": false
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* // Some time later....
|
* // Some time later....
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bFilter": false,
|
* "filter": false,
|
||||||
* "bDestroy": true
|
* "destroy": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8047,15 +8152,17 @@
|
|||||||
* specified (this allow matching across multiple columns). Note that if you
|
* specified (this allow matching across multiple columns). Note that if you
|
||||||
* wish to use filtering in DataTables this must remain 'true' - to remove the
|
* wish to use filtering in DataTables this must remain 'true' - to remove the
|
||||||
* default filtering input box and retain filtering abilities, please use
|
* default filtering input box and retain filtering abilities, please use
|
||||||
* {@link DataTable.defaults.sDom}.
|
* {@link DataTable.defaults.dom}.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.filter
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bFilter": false
|
* "filter": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8068,12 +8175,14 @@
|
|||||||
* about filtered data if that action is being performed.
|
* about filtered data if that action is being performed.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.info
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bInfo": false
|
* "info": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8086,12 +8195,14 @@
|
|||||||
* traditionally used).
|
* traditionally used).
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.jQueryUI
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bJQueryUI": true
|
* "jQueryUI": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8100,15 +8211,17 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows the end user to select the size of a formatted page from a select
|
* Allows the end user to select the size of a formatted page from a select
|
||||||
* menu (sizes are 10, 25, 50 and 100). Requires pagination (bPaginate).
|
* menu (sizes are 10, 25, 50 and 100). Requires pagination (`paginate`).
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.lengthChange
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bLengthChange": false
|
* "lengthChange": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8119,12 +8232,14 @@
|
|||||||
* Enable or disable pagination.
|
* Enable or disable pagination.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.paginate
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bPaginate": false
|
* "paginate": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8138,12 +8253,14 @@
|
|||||||
* the entries.
|
* the entries.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.processing
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bProcessing": true
|
* "processing": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8156,11 +8273,13 @@
|
|||||||
* to simply return the object that has already been set up - it will not take
|
* to simply return the object that has already been set up - it will not take
|
||||||
* account of any changes you might have made to the initialisation object
|
* account of any changes you might have made to the initialisation object
|
||||||
* passed to DataTables (setting this parameter to true is an acknowledgement
|
* passed to DataTables (setting this parameter to true is an acknowledgement
|
||||||
* that you understand this). bDestroy can be used to reinitialise a table if
|
* that you understand this). `destroy` can be used to reinitialise a table if
|
||||||
* you need.
|
* you need.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.retrieve
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
@ -8171,15 +8290,15 @@
|
|||||||
* function initTable ()
|
* function initTable ()
|
||||||
* {
|
* {
|
||||||
* return $('#example').dataTable( {
|
* return $('#example').dataTable( {
|
||||||
* "sScrollY": "200px",
|
* "scrollY": "200px",
|
||||||
* "bPaginate": false,
|
* "paginate": false,
|
||||||
* "bRetrieve": true
|
* "retrieve": true
|
||||||
* } );
|
* } );
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* function tableActions ()
|
* function tableActions ()
|
||||||
* {
|
* {
|
||||||
* var oTable = initTable();
|
* var table = initTable();
|
||||||
* // perform API operations with oTable
|
* // perform API operations with oTable
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
@ -8192,13 +8311,15 @@
|
|||||||
* this.
|
* this.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.scrollAutoCss
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bScrollAutoCss": false,
|
* "scrollAutoCss": false,
|
||||||
* "sScrollY": "200px"
|
* "scrollY": "200px"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8214,13 +8335,15 @@
|
|||||||
* the result set will fit within the given Y height.
|
* the result set will fit within the given Y height.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.scrollCollapse
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sScrollY": "200",
|
* "scrollY": "200",
|
||||||
* "bScrollCollapse": true
|
* "scrollCollapse": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8229,21 +8352,23 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable infinite scrolling for DataTables (to be used in combination with
|
* Enable infinite scrolling for DataTables (to be used in combination with
|
||||||
* sScrollY). Infinite scrolling means that DataTables will continually load
|
* `scrollY`). Infinite scrolling means that DataTables will continually load
|
||||||
* data as a user scrolls through a table, which is very useful for large
|
* data as a user scrolls through a table, which is very useful for large
|
||||||
* dataset. This cannot be used with pagination, which is automatically
|
* dataset. This cannot be used with pagination, which is automatically
|
||||||
* disabled. Note - the Scroller extra for DataTables is recommended in
|
* disabled. *Note*: the Scroller extra for DataTables is recommended in
|
||||||
* in preference to this option.
|
* in preference to this option.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.scrollInfinite
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bScrollInfinite": true,
|
* "scrollInfinite": true,
|
||||||
* "bScrollCollapse": true,
|
* "scrollCollapse": true,
|
||||||
* "sScrollY": "200px"
|
* "scrollY": "200px"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8252,18 +8377,20 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure DataTables to use server-side processing. Note that the
|
* Configure DataTables to use server-side processing. Note that the
|
||||||
* sAjaxSource parameter must also be given in order to give DataTables a
|
* `ajaxSource` parameter must also be given in order to give DataTables a
|
||||||
* source to obtain the required data for each draw.
|
* source to obtain the required data for each draw.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.serverSide
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "xhr.php"
|
* "ajaxSource": "xhr.php"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8272,15 +8399,17 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable sorting of columns. Sorting of individual columns can be
|
* Enable or disable sorting of columns. Sorting of individual columns can be
|
||||||
* disabled by the "bSortable" option for each column.
|
* disabled by the `sortable` option for each column.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.sort
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bSort": false
|
* "sort": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8293,12 +8422,14 @@
|
|||||||
* This is useful when using complex headers.
|
* This is useful when using complex headers.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.sortCellsTop
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bSortCellsTop": true
|
* "sortCellsTop": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8313,12 +8444,14 @@
|
|||||||
* turn this off.
|
* turn this off.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.sortClasses
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bSortClasses": false
|
* "sortClasses": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8332,12 +8465,14 @@
|
|||||||
* display display will match what thy had previously set up.
|
* display display will match what thy had previously set up.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.stateSave
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true
|
* "stateSave": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8349,22 +8484,24 @@
|
|||||||
* DataTables with state saving enabled. This function is called whenever
|
* DataTables with state saving enabled. This function is called whenever
|
||||||
* the cookie is modified, and it expects a fully formed cookie string to be
|
* the cookie is modified, and it expects a fully formed cookie string to be
|
||||||
* returned. Note that the data object passed in is a Javascript object which
|
* returned. Note that the data object passed in is a Javascript object which
|
||||||
* must be converted to a string (JSON.stringify for example).
|
* must be converted to a string (`JSON.stringify` for example).
|
||||||
* @type function
|
* @type function
|
||||||
* @param {string} sName Name of the cookie defined by DataTables
|
* @param {string} name Name of the cookie defined by DataTables
|
||||||
* @param {object} oData Data to be stored in the cookie
|
* @param {object} data Data to be stored in the cookie
|
||||||
* @param {string} sExpires Cookie expires string
|
* @param {string} expires Cookie expires string
|
||||||
* @param {string} sPath Path of the cookie to set
|
* @param {string} path Path of the cookie to set
|
||||||
* @returns {string} Cookie formatted string (which should be encoded by
|
* @returns {string} Cookie formatted string (which should be encoded by
|
||||||
* using encodeURIComponent())
|
* using encodeURIComponent())
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.cookieCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnCookieCallback": function (sName, oData, sExpires, sPath) {
|
* "cookieCallback": function (name, data, expires, path) {
|
||||||
* // Customise oData or sName or whatever else here
|
* // Customise data or name or whatever else here
|
||||||
* return sName + "="+JSON.stringify(oData)+"; expires=" + sExpires +"; path=" + sPath;
|
* return name + "="+JSON.stringify(data)+"; expires=" + expires +"; path=" + path;
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -8377,19 +8514,21 @@
|
|||||||
* elements have been inserted), or registered if using a DOM source, allowing
|
* elements have been inserted), or registered if using a DOM source, allowing
|
||||||
* manipulation of the TR element (adding classes etc).
|
* manipulation of the TR element (adding classes etc).
|
||||||
* @type function
|
* @type function
|
||||||
* @param {node} nRow "TR" element for the current row
|
* @param {node} row "TR" element for the current row
|
||||||
* @param {array} aData Raw data array for this row
|
* @param {array} data Raw data array for this row
|
||||||
* @param {int} iDataIndex The index of this row in aoData
|
* @param {int} dataIndex The index of this row in the internal aoData array
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.createdRow
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnCreatedRow": function( nRow, aData, iDataIndex ) {
|
* "createdRow": function( row, data, dataIndex ) {
|
||||||
* // Bold the grade for all 'A' grade browsers
|
* // Bold the grade for all 'A' grade browsers
|
||||||
* if ( aData[4] == "A" )
|
* if ( data[4] == "A" )
|
||||||
* {
|
* {
|
||||||
* $('td:eq(4)', nRow).html( '<b>A</b>' );
|
* $('td:eq(4)', row).html( '<b>A</b>' );
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -8402,13 +8541,15 @@
|
|||||||
* This function is called on every 'draw' event, and allows you to
|
* This function is called on every 'draw' event, and allows you to
|
||||||
* dynamically modify any aspect you want about the created DOM.
|
* dynamically modify any aspect you want about the created DOM.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.drawCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnDrawCallback": function( oSettings ) {
|
* "fnDrawCallback": function( settings ) {
|
||||||
* alert( 'DataTables has redrawn the table' );
|
* alert( 'DataTables has redrawn the table' );
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -8421,21 +8562,23 @@
|
|||||||
* Identical to fnHeaderCallback() but for the table footer this function
|
* Identical to fnHeaderCallback() but for the table footer this function
|
||||||
* allows you to modify the table footer on every 'draw' even.
|
* allows you to modify the table footer on every 'draw' even.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {node} nFoot "TR" element for the footer
|
* @param {node} foot "TR" element for the footer
|
||||||
* @param {array} aData Full table data (as derived from the original HTML)
|
* @param {array} data Full table data (as derived from the original HTML)
|
||||||
* @param {int} iStart Index for the current display starting point in the
|
* @param {int} start Index for the current display starting point in the
|
||||||
* display array
|
* display array
|
||||||
* @param {int} iEnd Index for the current display ending point in the
|
* @param {int} end Index for the current display ending point in the
|
||||||
* display array
|
* display array
|
||||||
* @param {array int} aiDisplay Index array to translate the visual position
|
* @param {array int} display Index array to translate the visual position
|
||||||
* to the full data array
|
* to the full data array
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.footerCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnFooterCallback": function( nFoot, aData, iStart, iEnd, aiDisplay ) {
|
* "footerCallback": function( foot, data, start, end, display ) {
|
||||||
* nFoot.getElementsByTagName('th')[0].innerHTML = "Starting index is "+iStart;
|
* foot.getElementsByTagName('th')[0].innerHTML = "Starting index is "+start;
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
@ -8451,19 +8594,21 @@
|
|||||||
* function will override the default method DataTables uses.
|
* function will override the default method DataTables uses.
|
||||||
* @type function
|
* @type function
|
||||||
* @member
|
* @member
|
||||||
* @param {int} iIn number to be formatted
|
* @param {int} toFormat number to be formatted
|
||||||
* @returns {string} formatted string for DataTables to show the number
|
* @returns {string} formatted string for DataTables to show the number
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.formatNumber
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnFormatNumber": function ( iIn ) {
|
* "formatNumber": function ( toFormat ) {
|
||||||
* if ( iIn < 1000 ) {
|
* if ( toFormat < 1000 ) {
|
||||||
* return iIn;
|
* return toFormat;
|
||||||
* } else {
|
* } else {
|
||||||
* var
|
* var
|
||||||
* s=(iIn+""),
|
* s=(toFormat+""),
|
||||||
* a=s.split(""), out="",
|
* a=s.split(""), out="",
|
||||||
* iLen=s.length;
|
* iLen=s.length;
|
||||||
*
|
*
|
||||||
@ -8479,20 +8624,20 @@
|
|||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"fnFormatNumber": function ( iIn ) {
|
"fnFormatNumber": function ( toFormat ) {
|
||||||
if ( iIn < 1000 )
|
if ( toFormat < 1000 )
|
||||||
{
|
{
|
||||||
// A small optimisation for what is likely to be the majority of use cases
|
// A small optimisation for what is likely to be the majority of use cases
|
||||||
return iIn;
|
return toFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
var s=(iIn+""), a=s.split(""), out="", iLen=s.length;
|
var s=(toFormat+""), a=s.split(""), out="", iLen=s.length;
|
||||||
|
|
||||||
for ( var i=0 ; i<iLen ; i++ )
|
for ( var i=0 ; i<iLen ; i++ )
|
||||||
{
|
{
|
||||||
if ( i%3 === 0 && i !== 0 )
|
if ( i%3 === 0 && i !== 0 )
|
||||||
{
|
{
|
||||||
out = this.oLanguage.sInfoThousands+out;
|
out = this.language.infoThousands+out;
|
||||||
}
|
}
|
||||||
out = a[iLen-i-1]+out;
|
out = a[iLen-i-1]+out;
|
||||||
}
|
}
|
||||||
@ -8505,21 +8650,23 @@
|
|||||||
* dynamically modify the header row. This can be used to calculate and
|
* dynamically modify the header row. This can be used to calculate and
|
||||||
* display useful information about the table.
|
* display useful information about the table.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {node} nHead "TR" element for the header
|
* @param {node} head "TR" element for the header
|
||||||
* @param {array} aData Full table data (as derived from the original HTML)
|
* @param {array} data Full table data (as derived from the original HTML)
|
||||||
* @param {int} iStart Index for the current display starting point in the
|
* @param {int} start Index for the current display starting point in the
|
||||||
* display array
|
* display array
|
||||||
* @param {int} iEnd Index for the current display ending point in the
|
* @param {int} end Index for the current display ending point in the
|
||||||
* display array
|
* display array
|
||||||
* @param {array int} aiDisplay Index array to translate the visual position
|
* @param {array int} display Index array to translate the visual position
|
||||||
* to the full data array
|
* to the full data array
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.headerCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnHeaderCallback": function( nHead, aData, iStart, iEnd, aiDisplay ) {
|
* "fheaderCallback": function( head, data, start, end, display ) {
|
||||||
* nHead.getElementsByTagName('th')[0].innerHTML = "Displaying "+(iEnd-iStart)+" records";
|
* head.getElementsByTagName('th')[0].innerHTML = "Displaying "+(end-start)+" records";
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
@ -8535,20 +8682,22 @@
|
|||||||
* allows you to do exactly that.
|
* allows you to do exactly that.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} oSettings DataTables settings object
|
||||||
* @param {int} iStart Starting position in data for the draw
|
* @param {int} start Starting position in data for the draw
|
||||||
* @param {int} iEnd End position in data for the draw
|
* @param {int} end End position in data for the draw
|
||||||
* @param {int} iMax Total number of rows in the table (regardless of
|
* @param {int} max Total number of rows in the table (regardless of
|
||||||
* filtering)
|
* filtering)
|
||||||
* @param {int} iTotal Total number of rows in the data set, after filtering
|
* @param {int} total Total number of rows in the data set, after filtering
|
||||||
* @param {string} sPre The string that DataTables has formatted using it's
|
* @param {string} pre The string that DataTables has formatted using it's
|
||||||
* own rules
|
* own rules
|
||||||
* @returns {string} The string to be displayed in the information element.
|
* @returns {string} The string to be displayed in the information element.
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.infoCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnInfoCallback": function( oSettings, iStart, iEnd, iMax, iTotal, sPre ) {
|
* "infoCallback": function( settings, start, end, nax, total, pre ) {
|
||||||
* return iStart +" to "+ iEnd;
|
* return start +" to "+ end;
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -8561,15 +8710,17 @@
|
|||||||
* however, this does not hold true when using external language information
|
* however, this does not hold true when using external language information
|
||||||
* since that is obtained using an async XHR call.
|
* since that is obtained using an async XHR call.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @param {object} json The JSON object request from the server - only
|
* @param {object} json The JSON object request from the server - only
|
||||||
* present if client-side Ajax sourced data is used
|
* present if client-side Ajax sourced data is used
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.initComplete
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnInitComplete": function(oSettings, json) {
|
* "initComplete": function(settings, json) {
|
||||||
* alert( 'DataTables has finished its initialisation.' );
|
* alert( 'DataTables has finished its initialisation.' );
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -8583,15 +8734,17 @@
|
|||||||
* draw by returning false, any other return (including undefined) results in
|
* draw by returning false, any other return (including undefined) results in
|
||||||
* the full draw occurring).
|
* the full draw occurring).
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @returns {boolean} False will cancel the draw, anything else (including no
|
* @returns {boolean} False will cancel the draw, anything else (including no
|
||||||
* return) will allow it to complete.
|
* return) will allow it to complete.
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.preDrawCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnPreDrawCallback": function( oSettings ) {
|
* "preDrawCallback": function( settings ) {
|
||||||
* if ( $('#test').val() == 1 ) {
|
* if ( $('#test').val() == 1 ) {
|
||||||
* return false;
|
* return false;
|
||||||
* }
|
* }
|
||||||
@ -8607,21 +8760,22 @@
|
|||||||
* generated for each table draw, but before it is rendered on screen. This
|
* generated for each table draw, but before it is rendered on screen. This
|
||||||
* function might be used for setting the row class name etc.
|
* function might be used for setting the row class name etc.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {node} nRow "TR" element for the current row
|
* @param {node} row "TR" element for the current row
|
||||||
* @param {array} aData Raw data array for this row
|
* @param {array} data Raw data array for this row
|
||||||
* @param {int} iDisplayIndex The display index for the current table draw
|
* @param {int} displayIndex The display index for the current table draw
|
||||||
* @param {int} iDisplayIndexFull The index of the data in the full list of
|
* @param {int} displayIndexFull The index of the data in the full list of
|
||||||
* rows (after filtering)
|
* rows (after filtering)
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.rowCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
* "rowCallback": function( row, data, displayIndex, displayIndexFull ) {
|
||||||
* // Bold the grade for all 'A' grade browsers
|
* // Bold the grade for all 'A' grade browsers
|
||||||
* if ( aData[4] == "A" )
|
* if ( data[4] == "A" ) {
|
||||||
* {
|
* $('td:eq(4)', row).html( '<b>A</b>' );
|
||||||
* $('td:eq(4)', nRow).html( '<b>A</b>' );
|
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -8632,57 +8786,60 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This parameter allows you to override the default function which obtains
|
* This parameter allows you to override the default function which obtains
|
||||||
* the data from the server ($.getJSON) so something more suitable for your
|
* the data from the server so something more suitable for your application. For
|
||||||
* application. For example you could use POST data, or pull information from
|
* example you could use POST data, or pull information from a Gears or AIR
|
||||||
* a Gears or AIR database.
|
* database.
|
||||||
* @type function
|
* @type function
|
||||||
* @member
|
* @member
|
||||||
* @param {string} sSource HTTP source to obtain the data from (sAjaxSource)
|
* @param {string} source HTTP source to obtain the data from (`ajaxSource`)
|
||||||
* @param {array} aoData A key/value pair object containing the data to send
|
* @param {array} data A key/value pair object containing the data to send
|
||||||
* to the server
|
* to the server
|
||||||
* @param {function} fnCallback to be called on completion of the data get
|
* @param {function} callback to be called on completion of the data get
|
||||||
* process that will draw the data on the page.
|
* process that will draw the data on the page.
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.serverData
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // POST data to server
|
* // POST data to server (note you can use `serverMethod` to set the
|
||||||
|
* // HTTP method is that is all you want to use `serverData` for.
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bProcessing": true,
|
* "processing": true,
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "xhr.php",
|
* "ajaxSource": "xhr.php",
|
||||||
* "fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
|
* "serverData": function ( source, data, callback, settings ) {
|
||||||
* oSettings.jqXHR = $.ajax( {
|
* settings.jqXHR = $.ajax( {
|
||||||
* "dataType": 'json',
|
* "dataType": 'json',
|
||||||
* "type": "POST",
|
* "type": "POST",
|
||||||
* "url": sSource,
|
* "url": source,
|
||||||
* "data": aoData,
|
* "data": data,
|
||||||
* "success": fnCallback
|
* "success": callback
|
||||||
* } );
|
* } );
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"fnServerData": function ( sUrl, aoData, fnCallback, oSettings ) {
|
"fnServerData": function ( url, data, callback, settings ) {
|
||||||
oSettings.jqXHR = $.ajax( {
|
settings.jqXHR = $.ajax( {
|
||||||
"url": sUrl,
|
"url": url,
|
||||||
"data": aoData,
|
"data": data,
|
||||||
"success": function (json) {
|
"success": function (json) {
|
||||||
if ( json.sError ) {
|
if ( json.sError ) {
|
||||||
oSettings.oApi._fnLog( oSettings, 0, json.sError );
|
settings.oApi._fnLog( settings, 0, json.sError );
|
||||||
}
|
}
|
||||||
|
|
||||||
$(oSettings.oInstance).trigger('xhr', [oSettings, json]);
|
$(oSettings.oInstance).trigger('xhr', [settings, json]);
|
||||||
fnCallback( json );
|
callback( json );
|
||||||
},
|
},
|
||||||
"dataType": "json",
|
"dataType": "json",
|
||||||
"cache": false,
|
"cache": false,
|
||||||
"type": oSettings.sServerMethod,
|
"type": settings.sServerMethod,
|
||||||
"error": function (xhr, error, thrown) {
|
"error": function (xhr, error, thrown) {
|
||||||
if ( error == "parsererror" ) {
|
if ( error == "parsererror" ) {
|
||||||
oSettings.oApi._fnLog( oSettings, 0, "DataTables warning: JSON data from "+
|
settings.oApi._fnLog( settings, 0, "DataTables warning: JSON data from "+
|
||||||
"server could not be parsed. This is caused by a JSON formatting error." );
|
"server could not be parsed. This is caused by a JSON formatting error." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8697,24 +8854,26 @@
|
|||||||
* passed in parameter is the data set that has been constructed by
|
* passed in parameter is the data set that has been constructed by
|
||||||
* DataTables, and you can add to this or modify it as you require.
|
* DataTables, and you can add to this or modify it as you require.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {array} aoData Data array (array of objects which are name/value
|
* @param {array} data Data array (array of objects which are name/value
|
||||||
* pairs) that has been constructed by DataTables and will be sent to the
|
* pairs) that has been constructed by DataTables and will be sent to the
|
||||||
* server. In the case of Ajax sourced data with server-side processing
|
* server. In the case of Ajax sourced data with server-side processing
|
||||||
* this will be an empty array, for server-side processing there will be a
|
* this will be an empty array, for server-side processing there will be a
|
||||||
* significant number of parameters!
|
* significant number of parameters!
|
||||||
* @returns {undefined} Ensure that you modify the aoData array passed in,
|
* @returns {undefined} Ensure that you modify the data array passed in,
|
||||||
* as this is passed by reference.
|
* as this is passed by reference.
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.serverParams
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bProcessing": true,
|
* "processing": true,
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "scripts/server_processing.php",
|
* "ajaxSource": "scripts/server_processing.php",
|
||||||
* "fnServerParams": function ( aoData ) {
|
* "serverParams": function ( data ) {
|
||||||
* aoData.push( { "name": "more_data", "value": "my_value" } );
|
* data.push( { "name": "more_data", "value": "my_value" } );
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -8728,15 +8887,17 @@
|
|||||||
* cookie, but you might wish to use local storage (HTML5) or a server-side database.
|
* cookie, but you might wish to use local storage (HTML5) or a server-side database.
|
||||||
* @type function
|
* @type function
|
||||||
* @member
|
* @member
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @return {object} The DataTables state object to be loaded
|
* @return {object} The DataTables state object to be loaded
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.stateLoadCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateLoad": function (oSettings) {
|
* "stateLoadCallback": function (settings) {
|
||||||
* var o;
|
* var o;
|
||||||
*
|
*
|
||||||
* // Send an Ajax request to the server to get the data. Note that
|
* // Send an Ajax request to the server to get the data. Note that
|
||||||
@ -8755,8 +8916,8 @@
|
|||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"fnStateLoad": function ( oSettings ) {
|
"fnStateLoadCallback": function ( settings ) {
|
||||||
var sData = this.oApi._fnReadCookie( oSettings.sCookiePrefix+oSettings.sInstance );
|
var sData = this.oApi._fnReadCookie( settings.sCookiePrefix+settings.sInstance );
|
||||||
var oData;
|
var oData;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -8774,20 +8935,22 @@
|
|||||||
* Callback which allows modification of the saved state prior to loading that state.
|
* Callback which allows modification of the saved state prior to loading that state.
|
||||||
* This callback is called when the table is loading state from the stored data, but
|
* This callback is called when the table is loading state from the stored data, but
|
||||||
* prior to the settings object being modified by the saved state. Note that for
|
* prior to the settings object being modified by the saved state. Note that for
|
||||||
* plug-in authors, you should use the 'stateLoadParams' event to load parameters for
|
* plug-in authors, you should use the `stateLoadParams` event to load parameters for
|
||||||
* a plug-in.
|
* a plug-in.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @param {object} oData The state object that is to be loaded
|
* @param {object} data The state object that is to be loaded
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.stateLoadParams
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Remove a saved filter, so filtering is never loaded
|
* // Remove a saved filter, so filtering is never loaded
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateLoadParams": function (oSettings, oData) {
|
* "stateLoadParams": function (settings, data) {
|
||||||
* oData.oSearch.sSearch = "";
|
* data.oSearch.sSearch = "";
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -8796,8 +8959,8 @@
|
|||||||
* // Disallow state loading by returning false
|
* // Disallow state loading by returning false
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateLoadParams": function (oSettings, oData) {
|
* "stateLoadParams": function (settings, data) {
|
||||||
* return false;
|
* return false;
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -8810,17 +8973,19 @@
|
|||||||
* Callback that is called when the state has been loaded from the state saving method
|
* Callback that is called when the state has been loaded from the state saving method
|
||||||
* and the DataTables settings object has been modified as a result of the loaded state.
|
* and the DataTables settings object has been modified as a result of the loaded state.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @param {object} oData The state object that was loaded
|
* @param {object} data The state object that was loaded
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.stateLoaded
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Show an alert with the filtering value that was saved
|
* // Show an alert with the filtering value that was saved
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateLoaded": function (oSettings, oData) {
|
* "stateLoaded": function (settings, data) {
|
||||||
* alert( 'Saved filter was: '+oData.oSearch.sSearch );
|
* alert( 'Saved filter was: '+data.oSearch.sSearch );
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -8834,19 +8999,21 @@
|
|||||||
* might want to use local storage (HTML5) or a server-side database.
|
* might want to use local storage (HTML5) or a server-side database.
|
||||||
* @type function
|
* @type function
|
||||||
* @member
|
* @member
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @param {object} oData The state object to be saved
|
* @param {object} data The state object to be saved
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.stateSaveCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateSave": function (oSettings, oData) {
|
* "stateSaveCallback": function (settings, data) {
|
||||||
* // Send an Ajax request to the server with the state object
|
* // Send an Ajax request to the server with the state object
|
||||||
* $.ajax( {
|
* $.ajax( {
|
||||||
* "url": "/state_save",
|
* "url": "/state_save",
|
||||||
* "data": oData,
|
* "data": data,
|
||||||
* "dataType": "json",
|
* "dataType": "json",
|
||||||
* "method": "POST"
|
* "method": "POST"
|
||||||
* "success": function () {}
|
* "success": function () {}
|
||||||
@ -8855,13 +9022,13 @@
|
|||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"fnStateSave": function ( oSettings, oData ) {
|
"fnStateSaveCallback": function ( settings, data ) {
|
||||||
this.oApi._fnCreateCookie(
|
this.oApi._fnCreateCookie(
|
||||||
oSettings.sCookiePrefix+oSettings.sInstance,
|
settings.sCookiePrefix+settings.sInstance,
|
||||||
this.oApi._fnJsonString(oData),
|
this.oApi._fnJsonString(data),
|
||||||
oSettings.iCookieDuration,
|
settings.iCookieDuration,
|
||||||
oSettings.sCookiePrefix,
|
settings.sCookiePrefix,
|
||||||
oSettings.fnCookieCallback
|
settings.fnCookieCallback
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -8871,19 +9038,21 @@
|
|||||||
* has changed state a new state save is required. This method allows modification of
|
* has changed state a new state save is required. This method allows modification of
|
||||||
* the state saving object prior to actually doing the save, including addition or
|
* the state saving object prior to actually doing the save, including addition or
|
||||||
* other state properties or modification. Note that for plug-in authors, you should
|
* other state properties or modification. Note that for plug-in authors, you should
|
||||||
* use the 'stateSaveParams' event to save parameters for a plug-in.
|
* use the `stateSaveParams` event to save parameters for a plug-in.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @param {object} oData The state object to be saved
|
* @param {object} data The state object to be saved
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.stateSaveParams
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Remove a saved filter, so filtering is never saved
|
* // Remove a saved filter, so filtering is never saved
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateSaveParams": function (oSettings, oData) {
|
* "stateSaveParams": function (settings, data) {
|
||||||
* oData.oSearch.sSearch = "";
|
* data.oSearch.sSearch = "";
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -8896,22 +9065,24 @@
|
|||||||
* value is given in seconds.
|
* value is given in seconds.
|
||||||
* @type int
|
* @type int
|
||||||
* @default 7200 <i>(2 hours)</i>
|
* @default 7200 <i>(2 hours)</i>
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.cookieDuration
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "iCookieDuration": 60*60*24; // 1 day
|
* "cookieDuration": 60*60*24; // 1 day
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
"iCookieDuration": 7200,
|
"fnCookieDuration": 7200,
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When enabled DataTables will not make a request to the server for the first
|
* When enabled DataTables will not make a request to the server for the first
|
||||||
* page draw - rather it will use the data already on the page (no sorting etc
|
* page draw - rather it will use the data already on the page (no sorting etc
|
||||||
* will be applied to it), thus saving on an XHR at load time. iDeferLoading
|
* will be applied to it), thus saving on an XHR at load time. `deferLoading`
|
||||||
* is used to indicate that deferred loading is required, but it is also used
|
* is used to indicate that deferred loading is required, but it is also used
|
||||||
* to tell DataTables how many records there are in the full table (allowing
|
* to tell DataTables how many records there are in the full table (allowing
|
||||||
* the information element and pagination to be displayed correctly). In the case
|
* the information element and pagination to be displayed correctly). In the case
|
||||||
@ -8922,15 +9093,17 @@
|
|||||||
* to be shown correctly).
|
* to be shown correctly).
|
||||||
* @type int | array
|
* @type int | array
|
||||||
* @default null
|
* @default null
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.deferLoading
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // 57 records available in the table, no filtering applied
|
* // 57 records available in the table, no filtering applied
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "scripts/server_processing.php",
|
* "ajaxSource": "scripts/server_processing.php",
|
||||||
* "iDeferLoading": 57
|
* "deferLoading": 57
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
@ -8938,30 +9111,32 @@
|
|||||||
* // 57 records after filtering, 100 without filtering (an initial filter applied)
|
* // 57 records after filtering, 100 without filtering (an initial filter applied)
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "scripts/server_processing.php",
|
* "ajaxSource": "scripts/server_processing.php",
|
||||||
* "iDeferLoading": [ 57, 100 ],
|
* "deferLoading": [ 57, 100 ],
|
||||||
* "oSearch": {
|
* "search": {
|
||||||
* "sSearch": "my_filter"
|
* "search": "my_filter"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"iDeferLoading": null,
|
"bDeferLoading": null,
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number of rows to display on a single page when using pagination. If
|
* Number of rows to display on a single page when using pagination. If
|
||||||
* feature enabled (bLengthChange) then the end user will be able to override
|
* feature enabled (`lengthChange`) then the end user will be able to override
|
||||||
* this to a custom setting using a pop-up menu.
|
* this to a custom setting using a pop-up menu.
|
||||||
* @type int
|
* @type int
|
||||||
* @default 10
|
* @default 10
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.displayLength
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "iDisplayLength": 50
|
* "displayLength": 50
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -8975,12 +9150,14 @@
|
|||||||
* the third page, it should be "20".
|
* the third page, it should be "20".
|
||||||
* @type int
|
* @type int
|
||||||
* @default 0
|
* @default 0
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.displayStart
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "iDisplayStart": 20
|
* "displayStart": 20
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -8989,20 +9166,23 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The scroll gap is the amount of scrolling that is left to go before
|
* The scroll gap is the amount of scrolling that is left to go before
|
||||||
* DataTables will load the next 'page' of data automatically. You typically
|
* DataTables will load the next 'page' of data automatically when using
|
||||||
* want a gap which is big enough that the scrolling will be smooth for the
|
* `scrollInfinite`. You typically want a gap which is big enough that the
|
||||||
* user, while not so large that it will load more data than need.
|
* scrolling will be smooth for the user, while not so large that it will
|
||||||
|
* load more data than need.
|
||||||
* @type int
|
* @type int
|
||||||
* @default 100
|
* @default 100
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.scrollLoadGap
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bScrollInfinite": true,
|
* "scrollInfinite": true,
|
||||||
* "bScrollCollapse": true,
|
* "scrollCollapse": true,
|
||||||
* "sScrollY": "200px",
|
* "scrollY": "200px",
|
||||||
* "iScrollLoadGap": 50
|
* "scrollLoadGap": 50
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -9011,19 +9191,21 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* By default DataTables allows keyboard navigation of the table (sorting, paging,
|
* By default DataTables allows keyboard navigation of the table (sorting, paging,
|
||||||
* and filtering) by adding a tabindex attribute to the required elements. This
|
* and filtering) by adding a `tabindex` attribute to the required elements. This
|
||||||
* allows you to tab through the controls and press the enter key to activate them.
|
* allows you to tab through the controls and press the enter key to activate them.
|
||||||
* The tabindex is default 0, meaning that the tab follows the flow of the document.
|
* The tabindex is default 0, meaning that the tab follows the flow of the document.
|
||||||
* You can overrule this using this parameter if you wish. Use a value of -1 to
|
* You can overrule this using this parameter if you wish. Use a value of -1 to
|
||||||
* disable built-in keyboard navigation.
|
* disable built-in keyboard navigation.
|
||||||
* @type int
|
* @type int
|
||||||
* @default 0
|
* @default 0
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.tabIndex
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "iTabIndex": 1
|
* "tabIndex": 1
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -9035,6 +9217,7 @@
|
|||||||
* are defined in this object, allowing you to modified them individually or
|
* are defined in this object, allowing you to modified them individually or
|
||||||
* completely replace them all as required.
|
* completely replace them all as required.
|
||||||
* @namespace
|
* @namespace
|
||||||
|
* @name DataTable.defaults.language
|
||||||
*/
|
*/
|
||||||
"oLanguage": {
|
"oLanguage": {
|
||||||
/**
|
/**
|
||||||
@ -9042,6 +9225,7 @@
|
|||||||
* actually visible on the page, but will be read by screenreaders, and thus
|
* actually visible on the page, but will be read by screenreaders, and thus
|
||||||
* must be internationalised as well).
|
* must be internationalised as well).
|
||||||
* @namespace
|
* @namespace
|
||||||
|
* @name DataTable.defaults.language.aria
|
||||||
*/
|
*/
|
||||||
"oAria": {
|
"oAria": {
|
||||||
/**
|
/**
|
||||||
@ -9050,14 +9234,16 @@
|
|||||||
* Note that the column header is prefixed to this string.
|
* Note that the column header is prefixed to this string.
|
||||||
* @type string
|
* @type string
|
||||||
* @default : activate to sort column ascending
|
* @default : activate to sort column ascending
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.aria.sortAscending
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oAria": {
|
* "aria": {
|
||||||
* "sSortAscending": " - click/return to sort ascending"
|
* "sortAscending": " - click/return to sort ascending"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -9071,14 +9257,16 @@
|
|||||||
* Note that the column header is prefixed to this string.
|
* Note that the column header is prefixed to this string.
|
||||||
* @type string
|
* @type string
|
||||||
* @default : activate to sort column ascending
|
* @default : activate to sort column ascending
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.aria.sortDescending
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oAria": {
|
* "aria": {
|
||||||
* "sSortDescending": " - click/return to sort descending"
|
* "sortDescending": " - click/return to sort descending"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -9091,6 +9279,7 @@
|
|||||||
* Pagination string used by DataTables for the two built-in pagination
|
* Pagination string used by DataTables for the two built-in pagination
|
||||||
* control types ("two_button" and "full_numbers")
|
* control types ("two_button" and "full_numbers")
|
||||||
* @namespace
|
* @namespace
|
||||||
|
* @name DataTable.defaults.language.paginate
|
||||||
*/
|
*/
|
||||||
"oPaginate": {
|
"oPaginate": {
|
||||||
/**
|
/**
|
||||||
@ -9098,14 +9287,16 @@
|
|||||||
* button to take the user to the first page.
|
* button to take the user to the first page.
|
||||||
* @type string
|
* @type string
|
||||||
* @default First
|
* @default First
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.paginate.first
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oPaginate": {
|
* "paginate": {
|
||||||
* "sFirst": "First page"
|
* "first": "First page"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -9119,14 +9310,16 @@
|
|||||||
* button to take the user to the last page.
|
* button to take the user to the last page.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Last
|
* @default Last
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.paginate.last
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oPaginate": {
|
* "paginate": {
|
||||||
* "sLast": "Last page"
|
* "last": "Last page"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -9140,14 +9333,16 @@
|
|||||||
* next page).
|
* next page).
|
||||||
* @type string
|
* @type string
|
||||||
* @default Next
|
* @default Next
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.paginate.next
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oPaginate": {
|
* "paginate": {
|
||||||
* "sNext": "Next page"
|
* "next": "Next page"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -9161,14 +9356,16 @@
|
|||||||
* the previous page).
|
* the previous page).
|
||||||
* @type string
|
* @type string
|
||||||
* @default Previous
|
* @default Previous
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.paginate.previous
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oPaginate": {
|
* "paginate": {
|
||||||
* "sPrevious": "Previous page"
|
* "previous": "Previous page"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -9178,19 +9375,21 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This string is shown in preference to sZeroRecords when the table is
|
* This string is shown in preference to `zeroRecords` when the table is
|
||||||
* empty of data (regardless of filtering). Note that this is an optional
|
* empty of data (regardless of filtering). Note that this is an optional
|
||||||
* parameter - if it is not given, the value of sZeroRecords will be used
|
* parameter - if it is not given, the value of `zeroRecords` will be used
|
||||||
* instead (either the default or given value).
|
* instead (either the default or given value).
|
||||||
* @type string
|
* @type string
|
||||||
* @default No data available in table
|
* @default No data available in table
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.emptyTable
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sEmptyTable": "No data available in table"
|
* "emptyTable": "No data available in table"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9205,13 +9404,15 @@
|
|||||||
* can be freely moved or removed as the language requirements change.
|
* can be freely moved or removed as the language requirements change.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Showing _START_ to _END_ of _TOTAL_ entries
|
* @default Showing _START_ to _END_ of _TOTAL_ entries
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.info
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sInfo": "Got a total of _TOTAL_ entries to show (_START_ to _END_)"
|
* "info": "Got a total of _TOTAL_ entries to show (_START_ to _END_)"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9221,16 +9422,18 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Display information string for when the table is empty. Typically the
|
* Display information string for when the table is empty. Typically the
|
||||||
* format of this string should match sInfo.
|
* format of this string should match `info`.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Showing 0 to 0 of 0 entries
|
* @default Showing 0 to 0 of 0 entries
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.infoEmpty
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sInfoEmpty": "No entries to show"
|
* "infoEmpty": "No entries to show"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9240,17 +9443,19 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When a user filters the information in a table, this string is appended
|
* When a user filters the information in a table, this string is appended
|
||||||
* to the information (sInfo) to give an idea of how strong the filtering
|
* to the information (`info`) to give an idea of how strong the filtering
|
||||||
* is. The variable _MAX_ is dynamically updated.
|
* is. The variable _MAX_ is dynamically updated.
|
||||||
* @type string
|
* @type string
|
||||||
* @default (filtered from _MAX_ total entries)
|
* @default (filtered from _MAX_ total entries)
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.infoFiltered
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sInfoFiltered": " - filtering from _MAX_ records"
|
* "infoFiltered": " - filtering from _MAX_ records"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9261,17 +9466,19 @@
|
|||||||
/**
|
/**
|
||||||
* If can be useful to append extra information to the info string at times,
|
* If can be useful to append extra information to the info string at times,
|
||||||
* and this variable does exactly that. This information will be appended to
|
* and this variable does exactly that. This information will be appended to
|
||||||
* the sInfo (sInfoEmpty and sInfoFiltered in whatever combination they are
|
* the `info` (`infoEmpty` and `infoFiltered` in whatever combination they are
|
||||||
* being used) at all times.
|
* being used) at all times.
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>Empty string</i>
|
* @default <i>Empty string</i>
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.infoPostFix
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sInfoPostFix": "All records shown are derived from real information."
|
* "infoPostFix": "All records shown are derived from real information."
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9280,19 +9487,21 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DataTables has a build in number formatter (fnFormatNumber) which is used
|
* DataTables has a build in number formatter (`formatNumber`) which is used
|
||||||
* to format large numbers that are used in the table information. By
|
* to format large numbers that are used in the table information. By
|
||||||
* default a comma is used, but this can be trivially changed to any
|
* default a comma is used, but this can be trivially changed to any
|
||||||
* character you wish with this parameter.
|
* character you wish with this parameter.
|
||||||
* @type string
|
* @type string
|
||||||
* @default ,
|
* @default ,
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.infoThousands
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sInfoThousands": "'"
|
* "infoThousands": "'"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9307,14 +9516,16 @@
|
|||||||
* with a custom select box if required.
|
* with a custom select box if required.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Show _MENU_ entries
|
* @default Show _MENU_ entries
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.lengthMenu
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Language change only
|
* // Language change only
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sLengthMenu": "Display _MENU_ records"
|
* "lengthMenu": "Display _MENU_ records"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9323,8 +9534,8 @@
|
|||||||
* // Language and options change
|
* // Language and options change
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sLengthMenu": 'Display <select>'+
|
* "lengthMenu": 'Display <select>'+
|
||||||
* '<option value="10">10</option>'+
|
* '<option value="10">10</option>'+
|
||||||
* '<option value="20">20</option>'+
|
* '<option value="20">20</option>'+
|
||||||
* '<option value="30">30</option>'+
|
* '<option value="30">30</option>'+
|
||||||
@ -9347,13 +9558,15 @@
|
|||||||
* Ajax sourced data with client-side processing.
|
* Ajax sourced data with client-side processing.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Loading...
|
* @default Loading...
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.loadingRecords
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sLoadingRecords": "Please wait - loading..."
|
* "loadingRecords": "Please wait - loading..."
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9366,13 +9579,15 @@
|
|||||||
* (usually a sort command or similar).
|
* (usually a sort command or similar).
|
||||||
* @type string
|
* @type string
|
||||||
* @default Processing...
|
* @default Processing...
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.processing
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sProcessing": "DataTables is currently busy"
|
* "processing": "DataTables is currently busy"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9388,14 +9603,16 @@
|
|||||||
* then the input box is appended to the string automatically.
|
* then the input box is appended to the string automatically.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Search:
|
* @default Search:
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.search
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Input text box will be appended at the end automatically
|
* // Input text box will be appended at the end automatically
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sSearch": "Filter records:"
|
* "search": "Filter records:"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9404,8 +9621,8 @@
|
|||||||
* // Specify where the filter should appear
|
* // Specify where the filter should appear
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sSearch": "Apply filter _INPUT_ to table"
|
* "search": "Apply filter _INPUT_ to table"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9422,13 +9639,15 @@
|
|||||||
* the example language files to see how this works in action.
|
* the example language files to see how this works in action.
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>Empty string - i.e. disabled</i>
|
* @default <i>Empty string - i.e. disabled</i>
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.url
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sUrl": "http://www.sprymedia.co.uk/dataTables/lang.txt"
|
* "url": "http://www.sprymedia.co.uk/dataTables/lang.txt"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9438,17 +9657,19 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Text shown inside the table records when the is no information to be
|
* Text shown inside the table records when the is no information to be
|
||||||
* displayed after filtering. sEmptyTable is shown when there is simply no
|
* displayed after filtering. `emptyTable` is shown when there is simply no
|
||||||
* information in the table at all (regardless of filtering).
|
* information in the table at all (regardless of filtering).
|
||||||
* @type string
|
* @type string
|
||||||
* @default No matching records found
|
* @default No matching records found
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.zeroRecords
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sZeroRecords": "No records to display"
|
* "zeroRecords": "No records to display"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -9459,20 +9680,22 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This parameter allows you to have define the global filtering state at
|
* This parameter allows you to have define the global filtering state at
|
||||||
* initialisation time. As an object the "sSearch" parameter must be
|
* initialisation time. As an object the `search` parameter must be
|
||||||
* defined, but all other parameters are optional. When "bRegex" is true,
|
* defined, but all other parameters are optional. When `regex` is true,
|
||||||
* the search string will be treated as a regular expression, when false
|
* the search string will be treated as a regular expression, when false
|
||||||
* (default) it will be treated as a straight string. When "bSmart"
|
* (default) it will be treated as a straight string. When `smart`
|
||||||
* DataTables will use it's smart filtering methods (to word match at
|
* DataTables will use it's smart filtering methods (to word match at
|
||||||
* any point in the data), when false this will not be done.
|
* any point in the data), when false this will not be done.
|
||||||
* @namespace
|
* @namespace
|
||||||
* @extends DataTable.models.oSearch
|
* @extends DataTable.models.oSearch
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.search
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oSearch": {"sSearch": "Initial search"}
|
* "search": {"search": "Initial search"}
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -9486,15 +9709,17 @@
|
|||||||
* notation to get a data source for multiple levels of nesting.
|
* notation to get a data source for multiple levels of nesting.
|
||||||
* @type string
|
* @type string
|
||||||
* @default aaData
|
* @default aaData
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.ajaxDataProp
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Get data from { "data": [...] }
|
* // Get data from { "data": [...] }
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* var oTable = $('#example').dataTable( {
|
||||||
* "sAjaxSource": "sources/data.txt",
|
* "ajaxSource": "sources/data.txt",
|
||||||
* "sAjaxDataProp": "data"
|
* "ajaxDataProp": "data"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
@ -9502,8 +9727,8 @@
|
|||||||
* // Get data from { "data": { "inner": [...] } }
|
* // Get data from { "data": { "inner": [...] } }
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* var oTable = $('#example').dataTable( {
|
||||||
* "sAjaxSource": "sources/data.txt",
|
* "ajaxSource": "sources/data.txt",
|
||||||
* "sAjaxDataProp": "data.inner"
|
* "ajaxDataProp": "data.inner"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -9514,16 +9739,18 @@
|
|||||||
* You can instruct DataTables to load data from an external source using this
|
* You can instruct DataTables to load data from an external source using this
|
||||||
* parameter (use aData if you want to pass data in you already have). Simply
|
* parameter (use aData if you want to pass data in you already have). Simply
|
||||||
* provide a url a JSON object can be obtained from. This object must include
|
* provide a url a JSON object can be obtained from. This object must include
|
||||||
* the parameter 'aaData' which is the data source for the table.
|
* the parameter `aaData` which is the data source for the table.
|
||||||
* @type string
|
* @type string
|
||||||
* @default null
|
* @default null
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.ajaxSource
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sAjaxSource": "http://www.sprymedia.co.uk/dataTables/json.php"
|
* "ajaxSource": "/dataTables/json.php"
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -9535,12 +9762,14 @@
|
|||||||
* assigns to a cookie when state saving is enabled.
|
* assigns to a cookie when state saving is enabled.
|
||||||
* @type string
|
* @type string
|
||||||
* @default SpryMedia_DataTables_
|
* @default SpryMedia_DataTables_
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.cookiePrefix
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sCookiePrefix": "my_datatable_",
|
* "cookiePrefix": "my_datatable_",
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -9585,14 +9814,16 @@
|
|||||||
* </li>
|
* </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* @type string
|
* @type string
|
||||||
* @default lfrtip <i>(when bJQueryUI is false)</i> <b>or</b>
|
* @default lfrtip <i>(when `jQueryUI` is false)</i> <b>or</b>
|
||||||
* <"H"lfr>t<"F"ip> <i>(when bJQueryUI is true)</i>
|
* <"H"lfr>t<"F"ip> <i>(when `jQueryUI` is true)</i>
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.dom
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sDom": '<"top"i>rt<"bottom"flp><"clear">'
|
* "dom": '<"top"i>rt<"bottom"flp><"clear">'
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -9605,12 +9836,14 @@
|
|||||||
* the end user. Further methods can be added using the API (see below).
|
* the end user. Further methods can be added using the API (see below).
|
||||||
* @type string
|
* @type string
|
||||||
* @default two_button
|
* @default two_button
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.paginationType
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sPaginationType": "full_numbers"
|
* "paginationType": "full_numbers"
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -9625,13 +9858,15 @@
|
|||||||
* as a pixel measurement).
|
* as a pixel measurement).
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>blank string - i.e. disabled</i>
|
* @default <i>blank string - i.e. disabled</i>
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.scrollX
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sScrollX": "100%",
|
* "scrollX": "100%",
|
||||||
* "bScrollCollapse": true
|
* "scrollCollapse": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -9647,13 +9882,15 @@
|
|||||||
* measurement).
|
* measurement).
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>blank string - i.e. disabled</i>
|
* @default <i>blank string - i.e. disabled</i>
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.scrollXInner
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sScrollX": "100%",
|
* "scrollX": "100%",
|
||||||
* "sScrollXInner": "110%"
|
* "scrollXInner": "110%"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -9669,13 +9906,15 @@
|
|||||||
* (in which case it will be treated as a pixel measurement).
|
* (in which case it will be treated as a pixel measurement).
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>blank string - i.e. disabled</i>
|
* @default <i>blank string - i.e. disabled</i>
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.scrollY
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sScrollY": "200px",
|
* "scrollY": "200px",
|
||||||
* "bPaginate": false
|
* "paginate": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -9687,56 +9926,67 @@
|
|||||||
* processing or Ajax sourced data.
|
* processing or Ajax sourced data.
|
||||||
* @type string
|
* @type string
|
||||||
* @default GET
|
* @default GET
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.serverMethod
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "scripts/post.php",
|
* "ajaxSource": "scripts/post.php",
|
||||||
* "sServerMethod": "POST"
|
* "serverMethod": "POST"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"sServerMethod": "GET"
|
"sServerMethod": "GET"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_fnHungarianMap( DataTable.defaults );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Developer note - See note in model.defaults.js about the use of Hungarian
|
||||||
|
* notation and camel case.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Column options that can be given to DataTables at initialisation time.
|
* Column options that can be given to DataTables at initialisation time.
|
||||||
* @namespace
|
* @namespace
|
||||||
*/
|
*/
|
||||||
DataTable.defaults.columns = {
|
DataTable.defaults.column = {
|
||||||
/**
|
/**
|
||||||
* Allows a column's sorting to take multiple columns into account when
|
* Allows a column's sorting to take multiple columns into account when
|
||||||
* doing a sort. For example first name / last name columns make sense to
|
* doing a sort. For example first name / last name columns make sense to
|
||||||
* do a multi-column sort over the two columns.
|
* do a multi-column sort over the two columns.
|
||||||
* @type array
|
* @type array
|
||||||
* @default null <i>Takes the value of the column index automatically</i>
|
* @default null <i>Takes the value of the column index automatically</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.dataSort
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "aDataSort": [ 0, 1 ], "aTargets": [ 0 ] },
|
* { "dataSort": [ 0, 1 ], "targets": [ 0 ] },
|
||||||
* { "aDataSort": [ 1, 0 ], "aTargets": [ 1 ] },
|
* { "dataSort": [ 1, 0 ], "targets": [ 1 ] },
|
||||||
* { "aDataSort": [ 2, 3, 4 ], "aTargets": [ 2 ] }
|
* { "dataSort": [ 2, 3, 4 ], "targets": [ 2 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "aDataSort": [ 0, 1 ] },
|
* { "dataSort": [ 0, 1 ] },
|
||||||
* { "aDataSort": [ 1, 0 ] },
|
* { "dataSort": [ 1, 0 ] },
|
||||||
* { "aDataSort": [ 2, 3, 4 ] },
|
* { "dataSort": [ 2, 3, 4 ] },
|
||||||
* null,
|
* null,
|
||||||
* null
|
* null
|
||||||
* ]
|
* ]
|
||||||
@ -9752,29 +10002,31 @@
|
|||||||
* parameter.
|
* parameter.
|
||||||
* @type array
|
* @type array
|
||||||
* @default [ 'asc', 'desc' ]
|
* @default [ 'asc', 'desc' ]
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.sorting
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "asSorting": [ "asc" ], "aTargets": [ 1 ] },
|
* { "sorting": [ "asc" ], "targets": [ 1 ] },
|
||||||
* { "asSorting": [ "desc", "asc", "asc" ], "aTargets": [ 2 ] },
|
* { "sorting": [ "desc", "asc", "asc" ], "targets": [ 2 ] },
|
||||||
* { "asSorting": [ "desc" ], "aTargets": [ 3 ] }
|
* { "sorting": [ "desc" ], "targets": [ 3 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* null,
|
* null,
|
||||||
* { "asSorting": [ "asc" ] },
|
* { "sorting": [ "asc" ] },
|
||||||
* { "asSorting": [ "desc", "asc", "asc" ] },
|
* { "sorting": [ "desc", "asc", "asc" ] },
|
||||||
* { "asSorting": [ "desc" ] },
|
* { "sorting": [ "desc" ] },
|
||||||
* null
|
* null
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
@ -9787,23 +10039,25 @@
|
|||||||
* Enable or disable filtering on the data in this column.
|
* Enable or disable filtering on the data in this column.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.searchable
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "bSearchable": false, "aTargets": [ 0 ] }
|
* { "searchable": false, "targets": [ 0 ] }
|
||||||
* ] } );
|
* ] } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "bSearchable": false },
|
* { "searchable": false },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -9818,23 +10072,25 @@
|
|||||||
* Enable or disable sorting on this column.
|
* Enable or disable sorting on this column.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.sortable
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "bSortable": false, "aTargets": [ 0 ] }
|
* { "sortable": false, "targets": [ 0 ] }
|
||||||
* ] } );
|
* ] } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "bSortable": false },
|
* { "sortable": false },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -9849,23 +10105,25 @@
|
|||||||
* Enable or disable the display of this column.
|
* Enable or disable the display of this column.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.visible
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "bVisible": false, "aTargets": [ 0 ] }
|
* { "visible": false, "targets": [ 0 ] }
|
||||||
* ] } );
|
* ] } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "bVisible": false },
|
* { "visible": false },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -9882,21 +10140,23 @@
|
|||||||
* allowing you to modify the DOM element (add background colour for example) when the
|
* allowing you to modify the DOM element (add background colour for example) when the
|
||||||
* element is available.
|
* element is available.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {element} nTd The TD node that has been created
|
* @param {element} td The TD node that has been created
|
||||||
* @param {*} sData The Data for the cell
|
* @param {*} cellData The Data for the cell
|
||||||
* @param {array|object} oData The data for the whole row
|
* @param {array|object} rowData The data for the whole row
|
||||||
* @param {int} iRow The row index for the aoData data store
|
* @param {int} row The row index for the aoData data store
|
||||||
* @param {int} iCol The column index for aoColumns
|
* @param {int} col The column index for aoColumns
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.createdCell
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [ {
|
* "columnDefs": [ {
|
||||||
* "aTargets": [3],
|
* "targets": [3],
|
||||||
* "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
|
* "createdCell": function (td, cellData, rowData, row, col) {
|
||||||
* if ( sData == "1.7" ) {
|
* if ( cellData == "1.7" ) {
|
||||||
* $(nTd).css('color', 'blue')
|
* $(td).css('color', 'blue')
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } ]
|
* } ]
|
||||||
@ -9912,24 +10172,26 @@
|
|||||||
* on hidden columns for example.
|
* on hidden columns for example.
|
||||||
* @type int
|
* @type int
|
||||||
* @default -1 <i>Use automatically calculated column index</i>
|
* @default -1 <i>Use automatically calculated column index</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.dataSort
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "iDataSort": 1, "aTargets": [ 0 ] }
|
* { "dataSort": 1, "targets": [ 0 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "iDataSort": 1 },
|
* { "dataSort": 1 },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -9942,75 +10204,75 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This parameter has been replaced by mData in DataTables to ensure naming
|
* This parameter has been replaced by `data` in DataTables to ensure naming
|
||||||
* consistency. mDataProp can still be used, as there is backwards compatibility
|
* consistency. `dataProp` can still be used, as there is backwards compatibility
|
||||||
* in DataTables for this option, but it is strongly recommended that you use
|
* in DataTables for this option, but it is strongly recommended that you use
|
||||||
* mData in preference to mDataProp.
|
* `data` in preference to `dataProp`.
|
||||||
* @name DataTable.defaults.columns.mDataProp
|
* @name DataTable.defaults.column.dataProp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This property can be used to read data from any JSON data source property,
|
* This property can be used to read data from any JSON data source property,
|
||||||
* including deeply nested objects / properties. mData can be given in a
|
* including deeply nested objects / properties. `data` can be given in a
|
||||||
* number of different ways which effect its behaviour:
|
* number of different ways which effect its behaviour:
|
||||||
* <ul>
|
|
||||||
* <li>integer - treated as an array index for the data source. This is the
|
|
||||||
* default that DataTables uses (incrementally increased for each column).</li>
|
|
||||||
* <li>string - read an object property from the data source. Note that you can
|
|
||||||
* use Javascript dotted notation to read deep properties / arrays from the
|
|
||||||
* data source.</li>
|
|
||||||
* <li>null - the sDefaultContent option will be used for the cell (null
|
|
||||||
* by default, so you will need to specify the default content you want -
|
|
||||||
* typically an empty string). This can be useful on generated columns such
|
|
||||||
* as edit / delete action columns.</li>
|
|
||||||
* <li>function - the function given will be executed whenever DataTables
|
|
||||||
* needs to set or get the data for a cell in the column. The function
|
|
||||||
* takes three parameters:
|
|
||||||
* <ul>
|
|
||||||
* <li>{array|object} The data source for the row</li>
|
|
||||||
* <li>{string} The type call data requested - this will be 'set' when
|
|
||||||
* setting data or 'filter', 'display', 'type', 'sort' or undefined when
|
|
||||||
* gathering data. Note that when <i>undefined</i> is given for the type
|
|
||||||
* DataTables expects to get the raw data for the object back</li>
|
|
||||||
* <li>{*} Data to set when the second parameter is 'set'.</li>
|
|
||||||
* </ul>
|
|
||||||
* The return value from the function is not required when 'set' is the type
|
|
||||||
* of call, but otherwise the return is what will be used for the data
|
|
||||||
* requested.</li>
|
|
||||||
* </ul>
|
|
||||||
*
|
*
|
||||||
* Note that prior to DataTables 1.9.2 mData was called mDataProp. The name change
|
* * integer - treated as an array index for the data source. This is the
|
||||||
|
* default that DataTables uses (incrementally increased for each column).
|
||||||
|
* * string - read an object property from the data source. Note that you can
|
||||||
|
* use Javascript dotted notation to read deep properties / arrays from the
|
||||||
|
* data source.
|
||||||
|
* * null - the sDefaultContent option will be used for the cell (null
|
||||||
|
* by default, so you will need to specify the default content you want -
|
||||||
|
* typically an empty string). This can be useful on generated columns such
|
||||||
|
* as edit / delete action columns.
|
||||||
|
* * function - the function given will be executed whenever DataTables
|
||||||
|
* needs to set or get the data for a cell in the column. The function
|
||||||
|
* takes three parameters:
|
||||||
|
* * {array|object} The data source for the row
|
||||||
|
* * {string} The type call data requested - this will be 'set' when
|
||||||
|
* setting data or 'filter', 'display', 'type', 'sort' or undefined when
|
||||||
|
* gathering data. Note that when `undefined` is given for the type
|
||||||
|
* DataTables expects to get the raw data for the object back<
|
||||||
|
* * {*} Data to set when the second parameter is 'set'.
|
||||||
|
* * The return value from the function is not required when 'set' is the type
|
||||||
|
* of call, but otherwise the return is what will be used for the data
|
||||||
|
* requested.
|
||||||
|
*
|
||||||
|
* Note that prior to DataTables 1.9.2 `data` was called `mDataProp`. The name change
|
||||||
* reflects the flexibility of this property and is consistent with the naming of
|
* reflects the flexibility of this property and is consistent with the naming of
|
||||||
* mRender. If 'mDataProp' is given, then it will still be used by DataTables, as
|
* mRender. If 'mDataProp' is given, then it will still be used by DataTables, as
|
||||||
* it automatically maps the old name to the new if required.
|
* it automatically maps the old name to the new if required.
|
||||||
|
*
|
||||||
* @type string|int|function|null
|
* @type string|int|function|null
|
||||||
* @default null <i>Use automatically calculated column index</i>
|
* @default null <i>Use automatically calculated column index</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.data
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Read table data from objects
|
* // Read table data from objects
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sAjaxSource": "sources/deep.txt",
|
* "ajaxSource": "sources/deep.txt",
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "mData": "engine" },
|
* { "data": "engine" },
|
||||||
* { "mData": "browser" },
|
* { "data": "browser" },
|
||||||
* { "mData": "platform.inner" },
|
* { "data": "platform.inner" },
|
||||||
* { "mData": "platform.details.0" },
|
* { "data": "platform.details.0" },
|
||||||
* { "mData": "platform.details.1" }
|
* { "data": "platform.details.1" }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using mData as a function to provide different information for
|
* // Using `data` as a function to provide different information for
|
||||||
* // sorting, filtering and display. In this case, currency (price)
|
* // sorting, filtering and display. In this case, currency (price)
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [ {
|
* "columnDefs": [ {
|
||||||
* "aTargets": [ 0 ],
|
* "targets": [ 0 ],
|
||||||
* "mData": function ( source, type, val ) {
|
* "data": function ( source, type, val ) {
|
||||||
* if (type === 'set') {
|
* if (type === 'set') {
|
||||||
* source.price = val;
|
* source.price = val;
|
||||||
* // Store the computed dislay and filter values for efficiency
|
* // Store the computed dislay and filter values for efficiency
|
||||||
@ -10035,51 +10297,51 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This property is the rendering partner to mData and it is suggested that
|
* This property is the rendering partner to `data` and it is suggested that
|
||||||
* when you want to manipulate data for display (including filtering, sorting etc)
|
* when you want to manipulate data for display (including filtering, sorting etc)
|
||||||
* but not altering the underlying data for the table, use this property. mData
|
* but not altering the underlying data for the table, use this property. `data`
|
||||||
* can actually do everything this property can and more, but this parameter is
|
* can actually do everything this property can and more, but this parameter is
|
||||||
* easier to use since there is no 'set' option. Like mData is can be given
|
* easier to use since there is no 'set' option. Like `data` this can be given
|
||||||
* in a number of different ways to effect its behaviour, with the addition of
|
* in a number of different ways to effect its behaviour, with the addition of
|
||||||
* supporting array syntax for easy outputting of arrays (including arrays of
|
* supporting array syntax for easy outputting of arrays (including arrays of
|
||||||
* objects):
|
* objects):
|
||||||
* <ul>
|
*
|
||||||
* <li>integer - treated as an array index for the data source. This is the
|
* * integer - treated as an array index for the data source. This is the
|
||||||
* default that DataTables uses (incrementally increased for each column).</li>
|
* default that DataTables uses (incrementally increased for each column).
|
||||||
* <li>string - read an object property from the data source. Note that you can
|
* * string - read an object property from the data source. Note that you can
|
||||||
* use Javascript dotted notation to read deep properties / arrays from the
|
* use Javascript dotted notation to read deep properties / arrays from the
|
||||||
* data source and also array brackets to indicate that the data reader should
|
* data source and also array brackets to indicate that the data reader should
|
||||||
* loop over the data source array. When characters are given between the array
|
* loop over the data source array. When characters are given between the array
|
||||||
* brackets, these characters are used to join the data source array together.
|
* brackets, these characters are used to join the data source array together.
|
||||||
* For example: "accounts[, ].name" would result in a comma separated list with
|
* For example: "accounts[, ].name" would result in a comma separated list with
|
||||||
* the 'name' value from the 'accounts' array of objects.</li>
|
* the 'name' value from the 'accounts' array of objects.
|
||||||
* <li>function - the function given will be executed whenever DataTables
|
* * function - the function given will be executed whenever DataTables
|
||||||
* needs to set or get the data for a cell in the column. The function
|
* needs to set or get the data for a cell in the column. The function
|
||||||
* takes three parameters:
|
* takes three parameters:
|
||||||
* <ul>
|
* * {array|object} The data source for the row (based on `data`)
|
||||||
* <li>{array|object} The data source for the row (based on mData)</li>
|
* * {string} The type call data requested - this will be 'filter', 'display',
|
||||||
* <li>{string} The type call data requested - this will be 'filter', 'display',
|
* 'type' or 'sort'.
|
||||||
* 'type' or 'sort'.</li>
|
* * {array|object} The full data source for the row (not based on `data`)
|
||||||
* <li>{array|object} The full data source for the row (not based on mData)</li>
|
* * The return value from the function is what will be used for the data
|
||||||
* </ul>
|
* requested.
|
||||||
* The return value from the function is what will be used for the data
|
*
|
||||||
* requested.</li>
|
|
||||||
* </ul>
|
|
||||||
* @type string|int|function|null
|
* @type string|int|function|null
|
||||||
* @default null <i>Use mData</i>
|
* @default null _Use `data`_
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.render
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Create a comma separated list from an array of objects
|
* // Create a comma separated list from an array of objects
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sAjaxSource": "sources/deep.txt",
|
* "ajaxSource": "sources/deep.txt",
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "mData": "engine" },
|
* { "data": "engine" },
|
||||||
* { "mData": "browser" },
|
* { "data": "browser" },
|
||||||
* {
|
* {
|
||||||
* "mData": "platform",
|
* "data": "platform",
|
||||||
* "mRender": "[, ].name"
|
* "render": "[, ].name"
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
@ -10088,12 +10350,12 @@
|
|||||||
* @example
|
* @example
|
||||||
* // Use as a function to create a link from the data source
|
* // Use as a function to create a link from the data source
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* {
|
* {
|
||||||
* "aTargets": [ 0 ],
|
* "targets": [ 0 ],
|
||||||
* "mData": "download_link",
|
* "data": "download_link",
|
||||||
* "mRender": function ( data, type, full ) {
|
* "render": function ( data, type, full ) {
|
||||||
* return '<a href="'+data+'">Download</a>';
|
* return '<a href="'+data+'">Download</a>';
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
@ -10109,15 +10371,17 @@
|
|||||||
* to act as a header for a row (you may wish to add scope='row' to the TH elements).
|
* to act as a header for a row (you may wish to add scope='row' to the TH elements).
|
||||||
* @type string
|
* @type string
|
||||||
* @default td
|
* @default td
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.cellType
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Make the first column use TH cells
|
* // Make the first column use TH cells
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [ {
|
* "columnDefs": [ {
|
||||||
* "aTargets": [ 0 ],
|
* "targets": [ 0 ],
|
||||||
* "sCellType": "th"
|
* "cellType": "th"
|
||||||
* } ]
|
* } ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -10129,24 +10393,26 @@
|
|||||||
* Class to give to each cell in this column.
|
* Class to give to each cell in this column.
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>Empty string</i>
|
* @default <i>Empty string</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.class
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sClass": "my_class", "aTargets": [ 0 ] }
|
* { "class": "my_class", "targets": [ 0 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sClass": "my_class" },
|
* { "class": "my_class" },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -10166,22 +10432,23 @@
|
|||||||
* it into an DOM object and measuring that is horribly(!) slow). Thus as
|
* 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
|
* 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.
|
* text that is found to be the longest string for the column - i.e. padding.
|
||||||
* Generally you shouldn't need this, and it is not documented on the
|
* Generally you shouldn't need this!
|
||||||
* general DataTables.net documentation
|
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>Empty string<i>
|
* @default <i>Empty string<i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.contentPadding
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* {
|
* {
|
||||||
* "sContentPadding": "mmm"
|
* "contentPadding": "mmm"
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
@ -10192,37 +10459,39 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows a default value to be given for a column's data, and will be used
|
* 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 mData
|
* whenever a null data source is encountered (this can be because `data`
|
||||||
* is set to null, or because the data source itself is null).
|
* is set to null, or because the data source itself is null).
|
||||||
* @type string
|
* @type string
|
||||||
* @default null
|
* @default null
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.defaultContent
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* {
|
* {
|
||||||
* "mData": null,
|
* "data": null,
|
||||||
* "sDefaultContent": "Edit",
|
* "defaultContent": "Edit",
|
||||||
* "aTargets": [ -1 ]
|
* "targets": [ -1 ]
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* {
|
* {
|
||||||
* "mData": null,
|
* "data": null,
|
||||||
* "sDefaultContent": "Edit"
|
* "defaultContent": "Edit"
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
@ -10240,32 +10509,34 @@
|
|||||||
* client-side, your server-side code does not also need updating).
|
* client-side, your server-side code does not also need updating).
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>Empty string</i>
|
* @default <i>Empty string</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.name
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sName": "engine", "aTargets": [ 0 ] },
|
* { "name": "engine", "targets": [ 0 ] },
|
||||||
* { "sName": "browser", "aTargets": [ 1 ] },
|
* { "name": "browser", "targets": [ 1 ] },
|
||||||
* { "sName": "platform", "aTargets": [ 2 ] },
|
* { "name": "platform", "targets": [ 2 ] },
|
||||||
* { "sName": "version", "aTargets": [ 3 ] },
|
* { "name": "version", "targets": [ 3 ] },
|
||||||
* { "sName": "grade", "aTargets": [ 4 ] }
|
* { "name": "grade", "targets": [ 4 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sName": "engine" },
|
* { "name": "engine" },
|
||||||
* { "sName": "browser" },
|
* { "name": "browser" },
|
||||||
* { "sName": "platform" },
|
* { "name": "platform" },
|
||||||
* { "sName": "version" },
|
* { "name": "version" },
|
||||||
* { "sName": "grade" }
|
* { "name": "grade" }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -10280,32 +10551,34 @@
|
|||||||
* elements such as form inputs.
|
* elements such as form inputs.
|
||||||
* @type string
|
* @type string
|
||||||
* @default std
|
* @default std
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.sortDataType
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sSortDataType": "dom-text", "aTargets": [ 2, 3 ] },
|
* { "sortDataType": "dom-text", "targets": [ 2, 3 ] },
|
||||||
* { "sType": "numeric", "aTargets": [ 3 ] },
|
* { "type": "numeric", "targets": [ 3 ] },
|
||||||
* { "sSortDataType": "dom-select", "aTargets": [ 4 ] },
|
* { "sortDataType": "dom-select", "targets": [ 4 ] },
|
||||||
* { "sSortDataType": "dom-checkbox", "aTargets": [ 5 ] }
|
* { "sortDataType": "dom-checkbox", "targets": [ 5 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* { "sSortDataType": "dom-text" },
|
* { "sortDataType": "dom-text" },
|
||||||
* { "sSortDataType": "dom-text", "sType": "numeric" },
|
* { "sortDataType": "dom-text", "type": "numeric" },
|
||||||
* { "sSortDataType": "dom-select" },
|
* { "sortDataType": "dom-select" },
|
||||||
* { "sSortDataType": "dom-checkbox" }
|
* { "sortDataType": "dom-checkbox" }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -10318,24 +10591,26 @@
|
|||||||
* @type string
|
* @type string
|
||||||
* @default null <i>Derived from the 'TH' value for this column in the
|
* @default null <i>Derived from the 'TH' value for this column in the
|
||||||
* original HTML table.</i>
|
* original HTML table.</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.title
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sTitle": "My column title", "aTargets": [ 0 ] }
|
* { "title": "My column title", "targets": [ 0 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sTitle": "My column title" },
|
* { "title": "My column title" },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -10357,24 +10632,26 @@
|
|||||||
* plug-ins.
|
* plug-ins.
|
||||||
* @type string
|
* @type string
|
||||||
* @default null <i>Auto-detected from raw data</i>
|
* @default null <i>Auto-detected from raw data</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.type
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sType": "html", "aTargets": [ 0 ] }
|
* { "type": "html", "targets": [ 0 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sType": "html" },
|
* { "type": "html" },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -10393,24 +10670,26 @@
|
|||||||
* remains readable.
|
* remains readable.
|
||||||
* @type string
|
* @type string
|
||||||
* @default null <i>Automatic</i>
|
* @default null <i>Automatic</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.width
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sWidth": "20%", "aTargets": [ 0 ] }
|
* { "width": "20%", "targets": [ 0 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sWidth": "20%" },
|
* { "width": "20%" },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -10422,6 +10701,8 @@
|
|||||||
"sWidth": null
|
"sWidth": null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_fnHungarianMap( DataTable.defaults.column );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*jslint evil: true, undef: true, browser: true */
|
/*jslint evil: true, undef: true, browser: true */
|
||||||
/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns*/
|
/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns,_fnHungarianMap,_fnCamelToHungarian*/
|
||||||
|
|
||||||
(/** @lends <global> */function( window, document, undefined ) {
|
(/** @lends <global> */function( window, document, undefined ) {
|
||||||
|
|
||||||
@ -43,6 +43,9 @@
|
|||||||
}
|
}
|
||||||
(/** @lends <global> */function( $ ) {
|
(/** @lends <global> */function( $ ) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
require('core.compat.js');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DataTables is a plug-in for the jQuery Javascript library. It is a
|
* DataTables is a plug-in for the jQuery Javascript library. It is a
|
||||||
* highly flexible tool, based upon the foundations of progressive
|
* highly flexible tool, based upon the foundations of progressive
|
||||||
|
@ -113,7 +113,9 @@ this.oApi = {
|
|||||||
"_fnNodeToColumnIndex": _fnNodeToColumnIndex,
|
"_fnNodeToColumnIndex": _fnNodeToColumnIndex,
|
||||||
"_fnInfoMacros": _fnInfoMacros,
|
"_fnInfoMacros": _fnInfoMacros,
|
||||||
"_fnBrowserDetect": _fnBrowserDetect,
|
"_fnBrowserDetect": _fnBrowserDetect,
|
||||||
"_fnGetColumns": _fnGetColumns
|
"_fnGetColumns": _fnGetColumns,
|
||||||
|
"_fnHungarianMap": _fnHungarianMap,
|
||||||
|
"_fnCamelToHungarian": _fnCamelToHungarian
|
||||||
};
|
};
|
||||||
|
|
||||||
$.extend( DataTable.ext.oApi, this.oApi );
|
$.extend( DataTable.ext.oApi, this.oApi );
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
function _fnAddColumn( oSettings, nTh )
|
function _fnAddColumn( oSettings, nTh )
|
||||||
{
|
{
|
||||||
var oDefaults = DataTable.defaults.columns;
|
var oDefaults = DataTable.defaults.column;
|
||||||
var iCol = oSettings.aoColumns.length;
|
var iCol = oSettings.aoColumns.length;
|
||||||
var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {
|
var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {
|
||||||
"sSortingClass": oSettings.oClasses.sSortable,
|
"sSortingClass": oSettings.oClasses.sSortable,
|
||||||
@ -65,6 +65,9 @@ function _fnColumnOptions( oSettings, iCol, oOptions )
|
|||||||
/* User specified column options */
|
/* User specified column options */
|
||||||
if ( oOptions !== undefined && oOptions !== null )
|
if ( oOptions !== undefined && oOptions !== null )
|
||||||
{
|
{
|
||||||
|
// Map camel case parameters to their Hungarian counterparts
|
||||||
|
_fnCamelToHungarian( DataTable.defaults.column, oOptions );
|
||||||
|
|
||||||
/* Backwards compatibility for mDataProp */
|
/* Backwards compatibility for mDataProp */
|
||||||
if ( oOptions.mDataProp && !oOptions.mData )
|
if ( oOptions.mDataProp && !oOptions.mData )
|
||||||
{
|
{
|
||||||
@ -294,8 +297,8 @@ function _fnApplyColumnDefs( oSettings, aoColDefs, aoCols, fn )
|
|||||||
for ( i=aoColDefs.length-1 ; i>=0 ; i-- )
|
for ( i=aoColDefs.length-1 ; i>=0 ; i-- )
|
||||||
{
|
{
|
||||||
/* Each definition can target multiple columns, as it is an array */
|
/* Each definition can target multiple columns, as it is an array */
|
||||||
var aTargets = aoColDefs[i].aTargets;
|
var aTargets = aoColDefs[i].targets || aoColDefs[i].aTargets;
|
||||||
if ( !$.isArray( aTargets ) )
|
if ( ! $.isArray( aTargets ) )
|
||||||
{
|
{
|
||||||
_fnLog( oSettings, 1, 'aTargets must be an array of targets, not a '+(typeof aTargets) );
|
_fnLog( oSettings, 1, 'aTargets must be an array of targets, not a '+(typeof aTargets) );
|
||||||
}
|
}
|
||||||
|
100
media/src/core/core.compat.js
Normal file
100
media/src/core/core.compat.js
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a mapping object that allows camel case parameters to be looked up
|
||||||
|
* for their Hungarian counterparts. The mapping is stored in a private
|
||||||
|
* parameter called `_hungaianMap` which can be accessed on the source object.
|
||||||
|
* @param {object} o
|
||||||
|
* @memberof DataTable#oApi
|
||||||
|
*/
|
||||||
|
function _fnHungarianMap ( o )
|
||||||
|
{
|
||||||
|
var
|
||||||
|
hungarian = 'a aa ao as b fn i m o s ',
|
||||||
|
match,
|
||||||
|
newKey,
|
||||||
|
map = {};
|
||||||
|
|
||||||
|
$.each( o, function (key, val) {
|
||||||
|
match = key.match(/^([^A-Z]+?)([A-Z])/);
|
||||||
|
|
||||||
|
if ( match && hungarian.indexOf(match[1]+' ') !== -1 )
|
||||||
|
{
|
||||||
|
newKey = key.replace( match[0], match[2].toLowerCase() );
|
||||||
|
map[ newKey ] = key;
|
||||||
|
|
||||||
|
if ( match[1] === 'o' )
|
||||||
|
{
|
||||||
|
_fnHungarianMap( o[key] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
o._hungaianMap = map;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert from camel case parameters to Hungarian, based on a Hungarian map
|
||||||
|
* created by _fnHungarianMap.
|
||||||
|
* @param {object} src The model object which holds all parameters can has
|
||||||
|
* previously been run through `_fnHungarianMap`.
|
||||||
|
* @param {object} user The object to convert from camel case to Hungarian.
|
||||||
|
* @param {boolean} force When set to `true`, properties which already have a
|
||||||
|
* Hungarian value in the `user` object will be overwritten. Otherwise they
|
||||||
|
* won't be.
|
||||||
|
* @memberof DataTable#oApi
|
||||||
|
*/
|
||||||
|
function _fnCamelToHungarian ( src, user, force )
|
||||||
|
{
|
||||||
|
if ( ! src._hungaianMap )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hungarianKey;
|
||||||
|
|
||||||
|
$.each( user, function (key, val) {
|
||||||
|
hungarianKey = src._hungaianMap[ key ];
|
||||||
|
|
||||||
|
if ( hungarianKey !== undefined && (force || user[hungarianKey] === undefined) )
|
||||||
|
{
|
||||||
|
user[hungarianKey] = user[ key ];
|
||||||
|
|
||||||
|
if ( hungarianKey.charAt(0) === 'o' )
|
||||||
|
{
|
||||||
|
_fnCamelToHungarian( src[hungarianKey], user[key] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
* @param {object} oSettings dataTables settings object
|
||||||
|
* @memberof DataTable#oApi
|
||||||
|
*/
|
||||||
|
function _fnLanguageCompat( oLanguage )
|
||||||
|
{
|
||||||
|
var oDefaults = DataTable.defaults.oLanguage;
|
||||||
|
|
||||||
|
/* Backwards compatibility - if there is no sEmptyTable given, then use the same as
|
||||||
|
* sZeroRecords - assuming that is given.
|
||||||
|
*/
|
||||||
|
if ( !oLanguage.sEmptyTable && oLanguage.sZeroRecords &&
|
||||||
|
oDefaults.sEmptyTable === "No data available in table" )
|
||||||
|
{
|
||||||
|
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sEmptyTable' );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Likewise with loading records */
|
||||||
|
if ( !oLanguage.sLoadingRecords && oLanguage.sZeroRecords &&
|
||||||
|
oDefaults.sLoadingRecords === "Loading..." )
|
||||||
|
{
|
||||||
|
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sLoadingRecords' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -12,6 +12,17 @@ if ( this.nodeName.toLowerCase() != 'table' )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Convert the camel-case defaults to Hungarian */
|
||||||
|
_fnCamelToHungarian( DataTable.defaults, DataTable.defaults, true );
|
||||||
|
_fnCamelToHungarian( DataTable.defaults.column, DataTable.defaults.column, true );
|
||||||
|
|
||||||
|
/* Setting up the initialisation object */
|
||||||
|
if ( !oInit )
|
||||||
|
{
|
||||||
|
oInit = {};
|
||||||
|
}
|
||||||
|
_fnCamelToHungarian( DataTable.defaults, oInit );
|
||||||
|
|
||||||
/* Check to see if we are re-initialising a table */
|
/* Check to see if we are re-initialising a table */
|
||||||
for ( i=0, iLen=DataTable.settings.length ; i<iLen ; i++ )
|
for ( i=0, iLen=DataTable.settings.length ; i<iLen ; i++ )
|
||||||
{
|
{
|
||||||
@ -70,12 +81,6 @@ DataTable.settings.push( oSettings );
|
|||||||
// to the settings array, so we can self reference the table instance if more than one
|
// to the settings array, so we can self reference the table instance if more than one
|
||||||
oSettings.oInstance = (_that.length===1) ? _that : $(this).dataTable();
|
oSettings.oInstance = (_that.length===1) ? _that : $(this).dataTable();
|
||||||
|
|
||||||
/* Setting up the initialisation object */
|
|
||||||
if ( !oInit )
|
|
||||||
{
|
|
||||||
oInit = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Backwards compatibility, before we apply all the defaults
|
// Backwards compatibility, before we apply all the defaults
|
||||||
if ( oInit.oLanguage )
|
if ( oInit.oLanguage )
|
||||||
{
|
{
|
||||||
@ -215,6 +220,7 @@ if ( oInit.oLanguage.sUrl !== "" )
|
|||||||
oSettings.oLanguage.sUrl = oInit.oLanguage.sUrl;
|
oSettings.oLanguage.sUrl = oInit.oLanguage.sUrl;
|
||||||
$.getJSON( oSettings.oLanguage.sUrl, null, function( json ) {
|
$.getJSON( oSettings.oLanguage.sUrl, null, function( json ) {
|
||||||
_fnLanguageCompat( json );
|
_fnLanguageCompat( json );
|
||||||
|
_fnCamelToHungarian( DataTable.defaults.oLanguage, json );
|
||||||
$.extend( true, oSettings.oLanguage, oInit.oLanguage, json );
|
$.extend( true, oSettings.oLanguage, oInit.oLanguage, json );
|
||||||
_fnInitialise( oSettings );
|
_fnInitialise( oSettings );
|
||||||
} );
|
} );
|
||||||
|
@ -122,32 +122,3 @@ function _fnInitComplete ( oSettings, json )
|
|||||||
_fnCallbackFire( oSettings, 'aoInitComplete', 'init', [oSettings, json] );
|
_fnCallbackFire( oSettings, 'aoInitComplete', 'init', [oSettings, json] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
* @param {object} oSettings dataTables settings object
|
|
||||||
* @memberof DataTable#oApi
|
|
||||||
*/
|
|
||||||
function _fnLanguageCompat( oLanguage )
|
|
||||||
{
|
|
||||||
var oDefaults = DataTable.defaults.oLanguage;
|
|
||||||
|
|
||||||
/* Backwards compatibility - if there is no sEmptyTable given, then use the same as
|
|
||||||
* sZeroRecords - assuming that is given.
|
|
||||||
*/
|
|
||||||
if ( !oLanguage.sEmptyTable && oLanguage.sZeroRecords &&
|
|
||||||
oDefaults.sEmptyTable === "No data available in table" )
|
|
||||||
{
|
|
||||||
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sEmptyTable' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Likewise with loading records */
|
|
||||||
if ( !oLanguage.sLoadingRecords && oLanguage.sZeroRecords &&
|
|
||||||
oDefaults.sLoadingRecords === "Loading..." )
|
|
||||||
{
|
|
||||||
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sLoadingRecords' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* is held in the settings aoColumns array and contains all the information that
|
* is held in the settings aoColumns array and contains all the information that
|
||||||
* DataTables needs about each individual column.
|
* DataTables needs about each individual column.
|
||||||
*
|
*
|
||||||
* Note that this object is related to {@link DataTable.defaults.columns}
|
* Note that this object is related to {@link DataTable.defaults.column}
|
||||||
* but this one is the internal data store for DataTables's cache of 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
|
* It should NOT be manipulated outside of DataTables. Any configuration should
|
||||||
* be done through the initialisation options.
|
* be done through the initialisation options.
|
||||||
|
@ -1,38 +1,45 @@
|
|||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Developer note - See note in model.defaults.js about the use of Hungarian
|
||||||
|
* notation and camel case.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Column options that can be given to DataTables at initialisation time.
|
* Column options that can be given to DataTables at initialisation time.
|
||||||
* @namespace
|
* @namespace
|
||||||
*/
|
*/
|
||||||
DataTable.defaults.columns = {
|
DataTable.defaults.column = {
|
||||||
/**
|
/**
|
||||||
* Allows a column's sorting to take multiple columns into account when
|
* Allows a column's sorting to take multiple columns into account when
|
||||||
* doing a sort. For example first name / last name columns make sense to
|
* doing a sort. For example first name / last name columns make sense to
|
||||||
* do a multi-column sort over the two columns.
|
* do a multi-column sort over the two columns.
|
||||||
* @type array
|
* @type array
|
||||||
* @default null <i>Takes the value of the column index automatically</i>
|
* @default null <i>Takes the value of the column index automatically</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.dataSort
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "aDataSort": [ 0, 1 ], "aTargets": [ 0 ] },
|
* { "dataSort": [ 0, 1 ], "targets": [ 0 ] },
|
||||||
* { "aDataSort": [ 1, 0 ], "aTargets": [ 1 ] },
|
* { "dataSort": [ 1, 0 ], "targets": [ 1 ] },
|
||||||
* { "aDataSort": [ 2, 3, 4 ], "aTargets": [ 2 ] }
|
* { "dataSort": [ 2, 3, 4 ], "targets": [ 2 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "aDataSort": [ 0, 1 ] },
|
* { "dataSort": [ 0, 1 ] },
|
||||||
* { "aDataSort": [ 1, 0 ] },
|
* { "dataSort": [ 1, 0 ] },
|
||||||
* { "aDataSort": [ 2, 3, 4 ] },
|
* { "dataSort": [ 2, 3, 4 ] },
|
||||||
* null,
|
* null,
|
||||||
* null
|
* null
|
||||||
* ]
|
* ]
|
||||||
@ -48,29 +55,31 @@ DataTable.defaults.columns = {
|
|||||||
* parameter.
|
* parameter.
|
||||||
* @type array
|
* @type array
|
||||||
* @default [ 'asc', 'desc' ]
|
* @default [ 'asc', 'desc' ]
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.sorting
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "asSorting": [ "asc" ], "aTargets": [ 1 ] },
|
* { "sorting": [ "asc" ], "targets": [ 1 ] },
|
||||||
* { "asSorting": [ "desc", "asc", "asc" ], "aTargets": [ 2 ] },
|
* { "sorting": [ "desc", "asc", "asc" ], "targets": [ 2 ] },
|
||||||
* { "asSorting": [ "desc" ], "aTargets": [ 3 ] }
|
* { "sorting": [ "desc" ], "targets": [ 3 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* null,
|
* null,
|
||||||
* { "asSorting": [ "asc" ] },
|
* { "sorting": [ "asc" ] },
|
||||||
* { "asSorting": [ "desc", "asc", "asc" ] },
|
* { "sorting": [ "desc", "asc", "asc" ] },
|
||||||
* { "asSorting": [ "desc" ] },
|
* { "sorting": [ "desc" ] },
|
||||||
* null
|
* null
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
@ -83,23 +92,25 @@ DataTable.defaults.columns = {
|
|||||||
* Enable or disable filtering on the data in this column.
|
* Enable or disable filtering on the data in this column.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.searchable
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "bSearchable": false, "aTargets": [ 0 ] }
|
* { "searchable": false, "targets": [ 0 ] }
|
||||||
* ] } );
|
* ] } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "bSearchable": false },
|
* { "searchable": false },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -114,23 +125,25 @@ DataTable.defaults.columns = {
|
|||||||
* Enable or disable sorting on this column.
|
* Enable or disable sorting on this column.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.sortable
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "bSortable": false, "aTargets": [ 0 ] }
|
* { "sortable": false, "targets": [ 0 ] }
|
||||||
* ] } );
|
* ] } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "bSortable": false },
|
* { "sortable": false },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -145,23 +158,25 @@ DataTable.defaults.columns = {
|
|||||||
* Enable or disable the display of this column.
|
* Enable or disable the display of this column.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.visible
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "bVisible": false, "aTargets": [ 0 ] }
|
* { "visible": false, "targets": [ 0 ] }
|
||||||
* ] } );
|
* ] } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "bVisible": false },
|
* { "visible": false },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -178,21 +193,23 @@ DataTable.defaults.columns = {
|
|||||||
* allowing you to modify the DOM element (add background colour for example) when the
|
* allowing you to modify the DOM element (add background colour for example) when the
|
||||||
* element is available.
|
* element is available.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {element} nTd The TD node that has been created
|
* @param {element} td The TD node that has been created
|
||||||
* @param {*} sData The Data for the cell
|
* @param {*} cellData The Data for the cell
|
||||||
* @param {array|object} oData The data for the whole row
|
* @param {array|object} rowData The data for the whole row
|
||||||
* @param {int} iRow The row index for the aoData data store
|
* @param {int} row The row index for the aoData data store
|
||||||
* @param {int} iCol The column index for aoColumns
|
* @param {int} col The column index for aoColumns
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.createdCell
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [ {
|
* "columnDefs": [ {
|
||||||
* "aTargets": [3],
|
* "targets": [3],
|
||||||
* "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
|
* "createdCell": function (td, cellData, rowData, row, col) {
|
||||||
* if ( sData == "1.7" ) {
|
* if ( cellData == "1.7" ) {
|
||||||
* $(nTd).css('color', 'blue')
|
* $(td).css('color', 'blue')
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } ]
|
* } ]
|
||||||
@ -208,24 +225,26 @@ DataTable.defaults.columns = {
|
|||||||
* on hidden columns for example.
|
* on hidden columns for example.
|
||||||
* @type int
|
* @type int
|
||||||
* @default -1 <i>Use automatically calculated column index</i>
|
* @default -1 <i>Use automatically calculated column index</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.dataSort
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "iDataSort": 1, "aTargets": [ 0 ] }
|
* { "dataSort": 1, "targets": [ 0 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "iDataSort": 1 },
|
* { "dataSort": 1 },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -238,75 +257,75 @@ DataTable.defaults.columns = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This parameter has been replaced by mData in DataTables to ensure naming
|
* This parameter has been replaced by `data` in DataTables to ensure naming
|
||||||
* consistency. mDataProp can still be used, as there is backwards compatibility
|
* consistency. `dataProp` can still be used, as there is backwards compatibility
|
||||||
* in DataTables for this option, but it is strongly recommended that you use
|
* in DataTables for this option, but it is strongly recommended that you use
|
||||||
* mData in preference to mDataProp.
|
* `data` in preference to `dataProp`.
|
||||||
* @name DataTable.defaults.columns.mDataProp
|
* @name DataTable.defaults.column.dataProp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This property can be used to read data from any JSON data source property,
|
* This property can be used to read data from any JSON data source property,
|
||||||
* including deeply nested objects / properties. mData can be given in a
|
* including deeply nested objects / properties. `data` can be given in a
|
||||||
* number of different ways which effect its behaviour:
|
* number of different ways which effect its behaviour:
|
||||||
* <ul>
|
|
||||||
* <li>integer - treated as an array index for the data source. This is the
|
|
||||||
* default that DataTables uses (incrementally increased for each column).</li>
|
|
||||||
* <li>string - read an object property from the data source. Note that you can
|
|
||||||
* use Javascript dotted notation to read deep properties / arrays from the
|
|
||||||
* data source.</li>
|
|
||||||
* <li>null - the sDefaultContent option will be used for the cell (null
|
|
||||||
* by default, so you will need to specify the default content you want -
|
|
||||||
* typically an empty string). This can be useful on generated columns such
|
|
||||||
* as edit / delete action columns.</li>
|
|
||||||
* <li>function - the function given will be executed whenever DataTables
|
|
||||||
* needs to set or get the data for a cell in the column. The function
|
|
||||||
* takes three parameters:
|
|
||||||
* <ul>
|
|
||||||
* <li>{array|object} The data source for the row</li>
|
|
||||||
* <li>{string} The type call data requested - this will be 'set' when
|
|
||||||
* setting data or 'filter', 'display', 'type', 'sort' or undefined when
|
|
||||||
* gathering data. Note that when <i>undefined</i> is given for the type
|
|
||||||
* DataTables expects to get the raw data for the object back</li>
|
|
||||||
* <li>{*} Data to set when the second parameter is 'set'.</li>
|
|
||||||
* </ul>
|
|
||||||
* The return value from the function is not required when 'set' is the type
|
|
||||||
* of call, but otherwise the return is what will be used for the data
|
|
||||||
* requested.</li>
|
|
||||||
* </ul>
|
|
||||||
*
|
*
|
||||||
* Note that prior to DataTables 1.9.2 mData was called mDataProp. The name change
|
* * integer - treated as an array index for the data source. This is the
|
||||||
|
* default that DataTables uses (incrementally increased for each column).
|
||||||
|
* * string - read an object property from the data source. Note that you can
|
||||||
|
* use Javascript dotted notation to read deep properties / arrays from the
|
||||||
|
* data source.
|
||||||
|
* * null - the sDefaultContent option will be used for the cell (null
|
||||||
|
* by default, so you will need to specify the default content you want -
|
||||||
|
* typically an empty string). This can be useful on generated columns such
|
||||||
|
* as edit / delete action columns.
|
||||||
|
* * function - the function given will be executed whenever DataTables
|
||||||
|
* needs to set or get the data for a cell in the column. The function
|
||||||
|
* takes three parameters:
|
||||||
|
* * {array|object} The data source for the row
|
||||||
|
* * {string} The type call data requested - this will be 'set' when
|
||||||
|
* setting data or 'filter', 'display', 'type', 'sort' or undefined when
|
||||||
|
* gathering data. Note that when `undefined` is given for the type
|
||||||
|
* DataTables expects to get the raw data for the object back<
|
||||||
|
* * {*} Data to set when the second parameter is 'set'.
|
||||||
|
* * The return value from the function is not required when 'set' is the type
|
||||||
|
* of call, but otherwise the return is what will be used for the data
|
||||||
|
* requested.
|
||||||
|
*
|
||||||
|
* Note that prior to DataTables 1.9.2 `data` was called `mDataProp`. The name change
|
||||||
* reflects the flexibility of this property and is consistent with the naming of
|
* reflects the flexibility of this property and is consistent with the naming of
|
||||||
* mRender. If 'mDataProp' is given, then it will still be used by DataTables, as
|
* mRender. If 'mDataProp' is given, then it will still be used by DataTables, as
|
||||||
* it automatically maps the old name to the new if required.
|
* it automatically maps the old name to the new if required.
|
||||||
|
*
|
||||||
* @type string|int|function|null
|
* @type string|int|function|null
|
||||||
* @default null <i>Use automatically calculated column index</i>
|
* @default null <i>Use automatically calculated column index</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.data
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Read table data from objects
|
* // Read table data from objects
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sAjaxSource": "sources/deep.txt",
|
* "ajaxSource": "sources/deep.txt",
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "mData": "engine" },
|
* { "data": "engine" },
|
||||||
* { "mData": "browser" },
|
* { "data": "browser" },
|
||||||
* { "mData": "platform.inner" },
|
* { "data": "platform.inner" },
|
||||||
* { "mData": "platform.details.0" },
|
* { "data": "platform.details.0" },
|
||||||
* { "mData": "platform.details.1" }
|
* { "data": "platform.details.1" }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using mData as a function to provide different information for
|
* // Using `data` as a function to provide different information for
|
||||||
* // sorting, filtering and display. In this case, currency (price)
|
* // sorting, filtering and display. In this case, currency (price)
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [ {
|
* "columnDefs": [ {
|
||||||
* "aTargets": [ 0 ],
|
* "targets": [ 0 ],
|
||||||
* "mData": function ( source, type, val ) {
|
* "data": function ( source, type, val ) {
|
||||||
* if (type === 'set') {
|
* if (type === 'set') {
|
||||||
* source.price = val;
|
* source.price = val;
|
||||||
* // Store the computed dislay and filter values for efficiency
|
* // Store the computed dislay and filter values for efficiency
|
||||||
@ -331,51 +350,51 @@ DataTable.defaults.columns = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This property is the rendering partner to mData and it is suggested that
|
* This property is the rendering partner to `data` and it is suggested that
|
||||||
* when you want to manipulate data for display (including filtering, sorting etc)
|
* when you want to manipulate data for display (including filtering, sorting etc)
|
||||||
* but not altering the underlying data for the table, use this property. mData
|
* but not altering the underlying data for the table, use this property. `data`
|
||||||
* can actually do everything this property can and more, but this parameter is
|
* can actually do everything this property can and more, but this parameter is
|
||||||
* easier to use since there is no 'set' option. Like mData is can be given
|
* easier to use since there is no 'set' option. Like `data` this can be given
|
||||||
* in a number of different ways to effect its behaviour, with the addition of
|
* in a number of different ways to effect its behaviour, with the addition of
|
||||||
* supporting array syntax for easy outputting of arrays (including arrays of
|
* supporting array syntax for easy outputting of arrays (including arrays of
|
||||||
* objects):
|
* objects):
|
||||||
* <ul>
|
*
|
||||||
* <li>integer - treated as an array index for the data source. This is the
|
* * integer - treated as an array index for the data source. This is the
|
||||||
* default that DataTables uses (incrementally increased for each column).</li>
|
* default that DataTables uses (incrementally increased for each column).
|
||||||
* <li>string - read an object property from the data source. Note that you can
|
* * string - read an object property from the data source. Note that you can
|
||||||
* use Javascript dotted notation to read deep properties / arrays from the
|
* use Javascript dotted notation to read deep properties / arrays from the
|
||||||
* data source and also array brackets to indicate that the data reader should
|
* data source and also array brackets to indicate that the data reader should
|
||||||
* loop over the data source array. When characters are given between the array
|
* loop over the data source array. When characters are given between the array
|
||||||
* brackets, these characters are used to join the data source array together.
|
* brackets, these characters are used to join the data source array together.
|
||||||
* For example: "accounts[, ].name" would result in a comma separated list with
|
* For example: "accounts[, ].name" would result in a comma separated list with
|
||||||
* the 'name' value from the 'accounts' array of objects.</li>
|
* the 'name' value from the 'accounts' array of objects.
|
||||||
* <li>function - the function given will be executed whenever DataTables
|
* * function - the function given will be executed whenever DataTables
|
||||||
* needs to set or get the data for a cell in the column. The function
|
* needs to set or get the data for a cell in the column. The function
|
||||||
* takes three parameters:
|
* takes three parameters:
|
||||||
* <ul>
|
* * {array|object} The data source for the row (based on `data`)
|
||||||
* <li>{array|object} The data source for the row (based on mData)</li>
|
* * {string} The type call data requested - this will be 'filter', 'display',
|
||||||
* <li>{string} The type call data requested - this will be 'filter', 'display',
|
* 'type' or 'sort'.
|
||||||
* 'type' or 'sort'.</li>
|
* * {array|object} The full data source for the row (not based on `data`)
|
||||||
* <li>{array|object} The full data source for the row (not based on mData)</li>
|
* * The return value from the function is what will be used for the data
|
||||||
* </ul>
|
* requested.
|
||||||
* The return value from the function is what will be used for the data
|
*
|
||||||
* requested.</li>
|
|
||||||
* </ul>
|
|
||||||
* @type string|int|function|null
|
* @type string|int|function|null
|
||||||
* @default null <i>Use mData</i>
|
* @default null _Use `data`_
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.render
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Create a comma separated list from an array of objects
|
* // Create a comma separated list from an array of objects
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sAjaxSource": "sources/deep.txt",
|
* "ajaxSource": "sources/deep.txt",
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "mData": "engine" },
|
* { "data": "engine" },
|
||||||
* { "mData": "browser" },
|
* { "data": "browser" },
|
||||||
* {
|
* {
|
||||||
* "mData": "platform",
|
* "data": "platform",
|
||||||
* "mRender": "[, ].name"
|
* "render": "[, ].name"
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
@ -384,12 +403,12 @@ DataTable.defaults.columns = {
|
|||||||
* @example
|
* @example
|
||||||
* // Use as a function to create a link from the data source
|
* // Use as a function to create a link from the data source
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* {
|
* {
|
||||||
* "aTargets": [ 0 ],
|
* "targets": [ 0 ],
|
||||||
* "mData": "download_link",
|
* "data": "download_link",
|
||||||
* "mRender": function ( data, type, full ) {
|
* "render": function ( data, type, full ) {
|
||||||
* return '<a href="'+data+'">Download</a>';
|
* return '<a href="'+data+'">Download</a>';
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
@ -405,15 +424,17 @@ DataTable.defaults.columns = {
|
|||||||
* to act as a header for a row (you may wish to add scope='row' to the TH elements).
|
* to act as a header for a row (you may wish to add scope='row' to the TH elements).
|
||||||
* @type string
|
* @type string
|
||||||
* @default td
|
* @default td
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.cellType
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Make the first column use TH cells
|
* // Make the first column use TH cells
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [ {
|
* "columnDefs": [ {
|
||||||
* "aTargets": [ 0 ],
|
* "targets": [ 0 ],
|
||||||
* "sCellType": "th"
|
* "cellType": "th"
|
||||||
* } ]
|
* } ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -425,24 +446,26 @@ DataTable.defaults.columns = {
|
|||||||
* Class to give to each cell in this column.
|
* Class to give to each cell in this column.
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>Empty string</i>
|
* @default <i>Empty string</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.class
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sClass": "my_class", "aTargets": [ 0 ] }
|
* { "class": "my_class", "targets": [ 0 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sClass": "my_class" },
|
* { "class": "my_class" },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -462,22 +485,23 @@ DataTable.defaults.columns = {
|
|||||||
* it into an DOM object and measuring that is horribly(!) slow). Thus as
|
* 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
|
* 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.
|
* text that is found to be the longest string for the column - i.e. padding.
|
||||||
* Generally you shouldn't need this, and it is not documented on the
|
* Generally you shouldn't need this!
|
||||||
* general DataTables.net documentation
|
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>Empty string<i>
|
* @default <i>Empty string<i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.contentPadding
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* {
|
* {
|
||||||
* "sContentPadding": "mmm"
|
* "contentPadding": "mmm"
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
@ -488,37 +512,39 @@ DataTable.defaults.columns = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows a default value to be given for a column's data, and will be used
|
* 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 mData
|
* whenever a null data source is encountered (this can be because `data`
|
||||||
* is set to null, or because the data source itself is null).
|
* is set to null, or because the data source itself is null).
|
||||||
* @type string
|
* @type string
|
||||||
* @default null
|
* @default null
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.defaultContent
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* {
|
* {
|
||||||
* "mData": null,
|
* "data": null,
|
||||||
* "sDefaultContent": "Edit",
|
* "defaultContent": "Edit",
|
||||||
* "aTargets": [ -1 ]
|
* "targets": [ -1 ]
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* {
|
* {
|
||||||
* "mData": null,
|
* "data": null,
|
||||||
* "sDefaultContent": "Edit"
|
* "defaultContent": "Edit"
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
@ -536,32 +562,34 @@ DataTable.defaults.columns = {
|
|||||||
* client-side, your server-side code does not also need updating).
|
* client-side, your server-side code does not also need updating).
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>Empty string</i>
|
* @default <i>Empty string</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.name
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sName": "engine", "aTargets": [ 0 ] },
|
* { "name": "engine", "targets": [ 0 ] },
|
||||||
* { "sName": "browser", "aTargets": [ 1 ] },
|
* { "name": "browser", "targets": [ 1 ] },
|
||||||
* { "sName": "platform", "aTargets": [ 2 ] },
|
* { "name": "platform", "targets": [ 2 ] },
|
||||||
* { "sName": "version", "aTargets": [ 3 ] },
|
* { "name": "version", "targets": [ 3 ] },
|
||||||
* { "sName": "grade", "aTargets": [ 4 ] }
|
* { "name": "grade", "targets": [ 4 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sName": "engine" },
|
* { "name": "engine" },
|
||||||
* { "sName": "browser" },
|
* { "name": "browser" },
|
||||||
* { "sName": "platform" },
|
* { "name": "platform" },
|
||||||
* { "sName": "version" },
|
* { "name": "version" },
|
||||||
* { "sName": "grade" }
|
* { "name": "grade" }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -576,32 +604,34 @@ DataTable.defaults.columns = {
|
|||||||
* elements such as form inputs.
|
* elements such as form inputs.
|
||||||
* @type string
|
* @type string
|
||||||
* @default std
|
* @default std
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.sortDataType
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sSortDataType": "dom-text", "aTargets": [ 2, 3 ] },
|
* { "sortDataType": "dom-text", "targets": [ 2, 3 ] },
|
||||||
* { "sType": "numeric", "aTargets": [ 3 ] },
|
* { "type": "numeric", "targets": [ 3 ] },
|
||||||
* { "sSortDataType": "dom-select", "aTargets": [ 4 ] },
|
* { "sortDataType": "dom-select", "targets": [ 4 ] },
|
||||||
* { "sSortDataType": "dom-checkbox", "aTargets": [ 5 ] }
|
* { "sortDataType": "dom-checkbox", "targets": [ 5 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* { "sSortDataType": "dom-text" },
|
* { "sortDataType": "dom-text" },
|
||||||
* { "sSortDataType": "dom-text", "sType": "numeric" },
|
* { "sortDataType": "dom-text", "type": "numeric" },
|
||||||
* { "sSortDataType": "dom-select" },
|
* { "sortDataType": "dom-select" },
|
||||||
* { "sSortDataType": "dom-checkbox" }
|
* { "sortDataType": "dom-checkbox" }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -614,24 +644,26 @@ DataTable.defaults.columns = {
|
|||||||
* @type string
|
* @type string
|
||||||
* @default null <i>Derived from the 'TH' value for this column in the
|
* @default null <i>Derived from the 'TH' value for this column in the
|
||||||
* original HTML table.</i>
|
* original HTML table.</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.title
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sTitle": "My column title", "aTargets": [ 0 ] }
|
* { "title": "My column title", "targets": [ 0 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sTitle": "My column title" },
|
* { "title": "My column title" },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -653,24 +685,26 @@ DataTable.defaults.columns = {
|
|||||||
* plug-ins.
|
* plug-ins.
|
||||||
* @type string
|
* @type string
|
||||||
* @default null <i>Auto-detected from raw data</i>
|
* @default null <i>Auto-detected from raw data</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.type
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sType": "html", "aTargets": [ 0 ] }
|
* { "type": "html", "targets": [ 0 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sType": "html" },
|
* { "type": "html" },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -689,24 +723,26 @@ DataTable.defaults.columns = {
|
|||||||
* remains readable.
|
* remains readable.
|
||||||
* @type string
|
* @type string
|
||||||
* @default null <i>Automatic</i>
|
* @default null <i>Automatic</i>
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column.width
|
||||||
* @dtopt Columns
|
* @dtopt Columns
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumnDefs
|
* // Using `columnDefs`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumnDefs": [
|
* "columnDefs": [
|
||||||
* { "sWidth": "20%", "aTargets": [ 0 ] }
|
* { "width": "20%", "targets": [ 0 ] }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using aoColumns
|
* // Using `columns`
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sWidth": "20%" },
|
* { "width": "20%" },
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
* null,
|
* null,
|
||||||
@ -718,3 +754,5 @@ DataTable.defaults.columns = {
|
|||||||
"sWidth": null
|
"sWidth": null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_fnHungarianMap( DataTable.defaults.column );
|
||||||
|
|
||||||
|
@ -1,4 +1,19 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Developer note: The properties of the object below are given in Hungarian
|
||||||
|
* notation, that was used as the interface for DataTables prior to v1.10, however
|
||||||
|
* from v1.10 onwards the primary interface is camel case. In order to avoid
|
||||||
|
* breaking backwards compatibility utterly with this change, the Hungarian
|
||||||
|
* version is still, internally the primary interface, but is is not documented
|
||||||
|
* - hence the @name tags in each doc comment. This allows a Javascript function
|
||||||
|
* to create a map from Hungarian notation to camel case (going the other direction
|
||||||
|
* would require each property to be listed, which would at around 3K to the size
|
||||||
|
* of DataTables, while this method is about a 0.5K hit.
|
||||||
|
*
|
||||||
|
* Ultimately this does pave the way for Hungarian notation to be dropped
|
||||||
|
* completely, but that is a massive amount of work and will break current
|
||||||
|
* installs (therefore is on-hold until v2).
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialisation options that can be given to DataTables at initialisation
|
* Initialisation options that can be given to DataTables at initialisation
|
||||||
@ -13,31 +28,33 @@ DataTable.defaults = {
|
|||||||
* example with a custom Ajax call.
|
* example with a custom Ajax call.
|
||||||
* @type array
|
* @type array
|
||||||
* @default null
|
* @default null
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.data
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using a 2D array data source
|
* // Using a 2D array data source
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aaData": [
|
* "data": [
|
||||||
* ['Trident', 'Internet Explorer 4.0', 'Win 95+', 4, 'X'],
|
* ['Trident', 'Internet Explorer 4.0', 'Win 95+', 4, 'X'],
|
||||||
* ['Trident', 'Internet Explorer 5.0', 'Win 95+', 5, 'C'],
|
* ['Trident', 'Internet Explorer 5.0', 'Win 95+', 5, 'C'],
|
||||||
* ],
|
* ],
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sTitle": "Engine" },
|
* { "title": "Engine" },
|
||||||
* { "sTitle": "Browser" },
|
* { "title": "Browser" },
|
||||||
* { "sTitle": "Platform" },
|
* { "title": "Platform" },
|
||||||
* { "sTitle": "Version" },
|
* { "title": "Version" },
|
||||||
* { "sTitle": "Grade" }
|
* { "title": "Grade" }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Using an array of objects as a data source (mData)
|
* // Using an array of objects as a data source (`data`)
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aaData": [
|
* "data": [
|
||||||
* {
|
* {
|
||||||
* "engine": "Trident",
|
* "engine": "Trident",
|
||||||
* "browser": "Internet Explorer 4.0",
|
* "browser": "Internet Explorer 4.0",
|
||||||
@ -53,12 +70,12 @@ DataTable.defaults = {
|
|||||||
* "grade": "C"
|
* "grade": "C"
|
||||||
* }
|
* }
|
||||||
* ],
|
* ],
|
||||||
* "aoColumns": [
|
* "columns": [
|
||||||
* { "sTitle": "Engine", "mData": "engine" },
|
* { "title": "Engine", "data": "engine" },
|
||||||
* { "sTitle": "Browser", "mData": "browser" },
|
* { "title": "Browser", "data": "browser" },
|
||||||
* { "sTitle": "Platform", "mData": "platform" },
|
* { "title": "Platform", "data": "platform" },
|
||||||
* { "sTitle": "Version", "mData": "version" },
|
* { "title": "Version", "data": "version" },
|
||||||
* { "sTitle": "Grade", "mData": "grade" }
|
* { "title": "Grade", "data": "grade" }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -69,25 +86,27 @@ DataTable.defaults = {
|
|||||||
/**
|
/**
|
||||||
* If sorting is enabled, then DataTables will perform a first pass sort on
|
* 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,
|
* initialisation. You can define which column(s) the sort is performed upon,
|
||||||
* and the sorting direction, with this variable. The aaSorting array should
|
* and the sorting direction, with this variable. The `sorting` array should
|
||||||
* contain an array for each column to be sorted initially containing the
|
* contain an array for each column to be sorted initially containing the
|
||||||
* column's index and a direction string ('asc' or 'desc').
|
* column's index and a direction string ('asc' or 'desc').
|
||||||
* @type array
|
* @type array
|
||||||
* @default [[0,'asc']]
|
* @default [[0,'asc']]
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.sorting
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Sort by 3rd column first, and then 4th column
|
* // Sort by 3rd column first, and then 4th column
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aaSorting": [[2,'asc'], [3,'desc']]
|
* "sorting": [[2,'asc'], [3,'desc']]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* // No initial sorting
|
* // No initial sorting
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aaSorting": []
|
* "sorting": []
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -95,7 +114,7 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This parameter is basically identical to the aaSorting parameter, but
|
* This parameter is basically identical to the `sorting` parameter, but
|
||||||
* cannot be overridden by user interaction with the table. What this means
|
* 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
|
* 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
|
* always be forced on first - any sorting after that (from the user) will
|
||||||
@ -103,12 +122,14 @@ DataTable.defaults = {
|
|||||||
* together.
|
* together.
|
||||||
* @type array
|
* @type array
|
||||||
* @default null
|
* @default null
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.sortingFixed
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aaSortingFixed": [[0,'asc']]
|
* "sortingFixed": [[0,'asc']]
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -124,23 +145,25 @@ DataTable.defaults = {
|
|||||||
* displayed options (useful for language strings such as 'All').
|
* displayed options (useful for language strings such as 'All').
|
||||||
* @type array
|
* @type array
|
||||||
* @default [ 10, 25, 50, 100 ]
|
* @default [ 10, 25, 50, 100 ]
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.lengthMenu
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
|
* "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Setting the default display length as well as length menu
|
* // Setting the default display length as well as length menu
|
||||||
* // This is likely to be wanted if you remove the '10' option which
|
* // This is likely to be wanted if you remove the '10' option which
|
||||||
* // is the iDisplayLength default.
|
* // is the displayLength default.
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "iDisplayLength": 25,
|
* "displayLength": 25,
|
||||||
* "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]]
|
* "lengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]]
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -148,25 +171,27 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The aoColumns option in the initialisation parameter allows you to define
|
* The `columns` option in the initialisation parameter allows you to define
|
||||||
* details about the way individual columns behave. For a full list of
|
* details about the way individual columns behave. For a full list of
|
||||||
* column options that can be set, please see
|
* column options that can be set, please see
|
||||||
* {@link DataTable.defaults.columns}. Note that if you use aoColumns to
|
* {@link DataTable.defaults.column}. Note that if you use `columns` to
|
||||||
* define your columns, you must have an entry in the array for every single
|
* 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
|
* column that you have in your table (these can be null if you don't which
|
||||||
* to specify any options).
|
* to specify any options).
|
||||||
* @member
|
* @member
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.column
|
||||||
*/
|
*/
|
||||||
"aoColumns": null,
|
"aoColumns": null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Very similar to aoColumns, aoColumnDefs allows you to target a specific
|
* Very similar to `columns`, `columnDefs` allows you to target a specific
|
||||||
* column, multiple columns, or all columns, using the aTargets property of
|
* column, multiple columns, or all columns, using the `targets` property of
|
||||||
* each object in the array. This allows great flexibility when creating
|
* each object in the array. This allows great flexibility when creating
|
||||||
* tables, as the aoColumnDefs arrays can be of any length, targeting the
|
* tables, as the `columnDefs` arrays can be of any length, targeting the
|
||||||
* columns you specifically want. aoColumnDefs may use any of the column
|
* columns you specifically want. `columnDefs` may use any of the column
|
||||||
* options available: {@link DataTable.defaults.columns}, but it _must_
|
* options available: {@link DataTable.defaults.column}, but it _must_
|
||||||
* have aTargets defined in each object in the array. Values in the aTargets
|
* have `targets` defined in each object in the array. Values in the `targets`
|
||||||
* array may be:
|
* array may be:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>a string - class name will be matched on the TH for the column</li>
|
* <li>a string - class name will be matched on the TH for the column</li>
|
||||||
@ -175,28 +200,32 @@ DataTable.defaults = {
|
|||||||
* <li>the string "_all" - all columns (i.e. assign a default)</li>
|
* <li>the string "_all" - all columns (i.e. assign a default)</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* @member
|
* @member
|
||||||
|
*
|
||||||
|
* @name DataTable.defaults.columnDefs
|
||||||
*/
|
*/
|
||||||
"aoColumnDefs": null,
|
"aoColumnDefs": null,
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basically the same as oSearch, this parameter defines the individual column
|
* Basically the same as `search`, this parameter defines the individual column
|
||||||
* filtering state at initialisation time. The array must be of the same size
|
* filtering state at initialisation time. The array must be of the same size
|
||||||
* as the number of columns, and each element be an object with the parameters
|
* as the number of columns, and each element be an object with the parameters
|
||||||
* "sSearch" and "bEscapeRegex" (the latter is optional). 'null' is also
|
* `search` and `escapeRegex` (the latter is optional). 'null' is also
|
||||||
* accepted and the default will be used.
|
* accepted and the default will be used.
|
||||||
* @type array
|
* @type array
|
||||||
* @default []
|
* @default []
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.searchCols
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "aoSearchCols": [
|
* "searchCols": [
|
||||||
* null,
|
* null,
|
||||||
* { "sSearch": "My filter" },
|
* { "search": "My filter" },
|
||||||
* null,
|
* null,
|
||||||
* { "sSearch": "^[0-9]", "bEscapeRegex": false }
|
* { "search": "^[0-9]", "escapeRegex": false }
|
||||||
* ]
|
* ]
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
@ -209,14 +238,16 @@ DataTable.defaults = {
|
|||||||
* array may be of any length, and DataTables will apply each class
|
* array may be of any length, and DataTables will apply each class
|
||||||
* sequentially, looping when required.
|
* sequentially, looping when required.
|
||||||
* @type array
|
* @type array
|
||||||
* @default null <i>Will take the values determined by the oClasses.sStripe*
|
* @default null <i>Will take the values determined by the `oClasses.stripe*`
|
||||||
* options</i>
|
* options</i>
|
||||||
|
*
|
||||||
* @dtopt Option
|
* @dtopt Option
|
||||||
|
* @name DataTable.defaults.stripeClasses
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "asStripeClasses": [ 'strip1', 'strip2', 'strip3' ]
|
* "stripeClasses": [ 'strip1', 'strip2', 'strip3' ]
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -226,15 +257,17 @@ DataTable.defaults = {
|
|||||||
/**
|
/**
|
||||||
* Enable or disable automatic column width calculation. This can be disabled
|
* Enable or disable automatic column width calculation. This can be disabled
|
||||||
* as an optimisation (it takes some time to calculate the widths) if the
|
* as an optimisation (it takes some time to calculate the widths) if the
|
||||||
* tables widths are passed in using aoColumns.
|
* tables widths are passed in using `columns`.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.autoWidth
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bAutoWidth": false
|
* "autoWidth": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -249,13 +282,15 @@ DataTable.defaults = {
|
|||||||
* time.
|
* time.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.deferRender
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sAjaxSource": "sources/arrays.txt",
|
* "ajaxSource": "sources/arrays.txt",
|
||||||
* "bDeferRender": true
|
* "deferRender": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -269,19 +304,21 @@ DataTable.defaults = {
|
|||||||
* per normal.
|
* per normal.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.destroy
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sScrollY": "200px",
|
* "srollY": "200px",
|
||||||
* "bPaginate": false
|
* "paginate": false
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
* // Some time later....
|
* // Some time later....
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bFilter": false,
|
* "filter": false,
|
||||||
* "bDestroy": true
|
* "destroy": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -295,15 +332,17 @@ DataTable.defaults = {
|
|||||||
* specified (this allow matching across multiple columns). Note that if you
|
* specified (this allow matching across multiple columns). Note that if you
|
||||||
* wish to use filtering in DataTables this must remain 'true' - to remove the
|
* wish to use filtering in DataTables this must remain 'true' - to remove the
|
||||||
* default filtering input box and retain filtering abilities, please use
|
* default filtering input box and retain filtering abilities, please use
|
||||||
* {@link DataTable.defaults.sDom}.
|
* {@link DataTable.defaults.dom}.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.filter
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bFilter": false
|
* "filter": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -316,12 +355,14 @@ DataTable.defaults = {
|
|||||||
* about filtered data if that action is being performed.
|
* about filtered data if that action is being performed.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.info
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bInfo": false
|
* "info": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -334,12 +375,14 @@ DataTable.defaults = {
|
|||||||
* traditionally used).
|
* traditionally used).
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.jQueryUI
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bJQueryUI": true
|
* "jQueryUI": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -348,15 +391,17 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows the end user to select the size of a formatted page from a select
|
* Allows the end user to select the size of a formatted page from a select
|
||||||
* menu (sizes are 10, 25, 50 and 100). Requires pagination (bPaginate).
|
* menu (sizes are 10, 25, 50 and 100). Requires pagination (`paginate`).
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.lengthChange
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bLengthChange": false
|
* "lengthChange": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -367,12 +412,14 @@ DataTable.defaults = {
|
|||||||
* Enable or disable pagination.
|
* Enable or disable pagination.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.paginate
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bPaginate": false
|
* "paginate": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -386,12 +433,14 @@ DataTable.defaults = {
|
|||||||
* the entries.
|
* the entries.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.processing
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bProcessing": true
|
* "processing": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -404,11 +453,13 @@ DataTable.defaults = {
|
|||||||
* to simply return the object that has already been set up - it will not take
|
* to simply return the object that has already been set up - it will not take
|
||||||
* account of any changes you might have made to the initialisation object
|
* account of any changes you might have made to the initialisation object
|
||||||
* passed to DataTables (setting this parameter to true is an acknowledgement
|
* passed to DataTables (setting this parameter to true is an acknowledgement
|
||||||
* that you understand this). bDestroy can be used to reinitialise a table if
|
* that you understand this). `destroy` can be used to reinitialise a table if
|
||||||
* you need.
|
* you need.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.retrieve
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
@ -419,15 +470,15 @@ DataTable.defaults = {
|
|||||||
* function initTable ()
|
* function initTable ()
|
||||||
* {
|
* {
|
||||||
* return $('#example').dataTable( {
|
* return $('#example').dataTable( {
|
||||||
* "sScrollY": "200px",
|
* "scrollY": "200px",
|
||||||
* "bPaginate": false,
|
* "paginate": false,
|
||||||
* "bRetrieve": true
|
* "retrieve": true
|
||||||
* } );
|
* } );
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* function tableActions ()
|
* function tableActions ()
|
||||||
* {
|
* {
|
||||||
* var oTable = initTable();
|
* var table = initTable();
|
||||||
* // perform API operations with oTable
|
* // perform API operations with oTable
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
@ -440,13 +491,15 @@ DataTable.defaults = {
|
|||||||
* this.
|
* this.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.scrollAutoCss
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bScrollAutoCss": false,
|
* "scrollAutoCss": false,
|
||||||
* "sScrollY": "200px"
|
* "scrollY": "200px"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -462,13 +515,15 @@ DataTable.defaults = {
|
|||||||
* the result set will fit within the given Y height.
|
* the result set will fit within the given Y height.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.scrollCollapse
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sScrollY": "200",
|
* "scrollY": "200",
|
||||||
* "bScrollCollapse": true
|
* "scrollCollapse": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -477,21 +532,23 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable infinite scrolling for DataTables (to be used in combination with
|
* Enable infinite scrolling for DataTables (to be used in combination with
|
||||||
* sScrollY). Infinite scrolling means that DataTables will continually load
|
* `scrollY`). Infinite scrolling means that DataTables will continually load
|
||||||
* data as a user scrolls through a table, which is very useful for large
|
* data as a user scrolls through a table, which is very useful for large
|
||||||
* dataset. This cannot be used with pagination, which is automatically
|
* dataset. This cannot be used with pagination, which is automatically
|
||||||
* disabled. Note - the Scroller extra for DataTables is recommended in
|
* disabled. *Note*: the Scroller extra for DataTables is recommended in
|
||||||
* in preference to this option.
|
* in preference to this option.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.scrollInfinite
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bScrollInfinite": true,
|
* "scrollInfinite": true,
|
||||||
* "bScrollCollapse": true,
|
* "scrollCollapse": true,
|
||||||
* "sScrollY": "200px"
|
* "scrollY": "200px"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -500,18 +557,20 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure DataTables to use server-side processing. Note that the
|
* Configure DataTables to use server-side processing. Note that the
|
||||||
* sAjaxSource parameter must also be given in order to give DataTables a
|
* `ajaxSource` parameter must also be given in order to give DataTables a
|
||||||
* source to obtain the required data for each draw.
|
* source to obtain the required data for each draw.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.serverSide
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "xhr.php"
|
* "ajaxSource": "xhr.php"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -520,15 +579,17 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable sorting of columns. Sorting of individual columns can be
|
* Enable or disable sorting of columns. Sorting of individual columns can be
|
||||||
* disabled by the "bSortable" option for each column.
|
* disabled by the `sortable` option for each column.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.sort
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bSort": false
|
* "sort": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -541,12 +602,14 @@ DataTable.defaults = {
|
|||||||
* This is useful when using complex headers.
|
* This is useful when using complex headers.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.sortCellsTop
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bSortCellsTop": true
|
* "sortCellsTop": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -561,12 +624,14 @@ DataTable.defaults = {
|
|||||||
* turn this off.
|
* turn this off.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default true
|
* @default true
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.sortClasses
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bSortClasses": false
|
* "sortClasses": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -580,12 +645,14 @@ DataTable.defaults = {
|
|||||||
* display display will match what thy had previously set up.
|
* display display will match what thy had previously set up.
|
||||||
* @type boolean
|
* @type boolean
|
||||||
* @default false
|
* @default false
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.stateSave
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true
|
* "stateSave": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -597,22 +664,24 @@ DataTable.defaults = {
|
|||||||
* DataTables with state saving enabled. This function is called whenever
|
* DataTables with state saving enabled. This function is called whenever
|
||||||
* the cookie is modified, and it expects a fully formed cookie string to be
|
* the cookie is modified, and it expects a fully formed cookie string to be
|
||||||
* returned. Note that the data object passed in is a Javascript object which
|
* returned. Note that the data object passed in is a Javascript object which
|
||||||
* must be converted to a string (JSON.stringify for example).
|
* must be converted to a string (`JSON.stringify` for example).
|
||||||
* @type function
|
* @type function
|
||||||
* @param {string} sName Name of the cookie defined by DataTables
|
* @param {string} name Name of the cookie defined by DataTables
|
||||||
* @param {object} oData Data to be stored in the cookie
|
* @param {object} data Data to be stored in the cookie
|
||||||
* @param {string} sExpires Cookie expires string
|
* @param {string} expires Cookie expires string
|
||||||
* @param {string} sPath Path of the cookie to set
|
* @param {string} path Path of the cookie to set
|
||||||
* @returns {string} Cookie formatted string (which should be encoded by
|
* @returns {string} Cookie formatted string (which should be encoded by
|
||||||
* using encodeURIComponent())
|
* using encodeURIComponent())
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.cookieCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function () {
|
* $(document).ready( function () {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnCookieCallback": function (sName, oData, sExpires, sPath) {
|
* "cookieCallback": function (name, data, expires, path) {
|
||||||
* // Customise oData or sName or whatever else here
|
* // Customise data or name or whatever else here
|
||||||
* return sName + "="+JSON.stringify(oData)+"; expires=" + sExpires +"; path=" + sPath;
|
* return name + "="+JSON.stringify(data)+"; expires=" + expires +"; path=" + path;
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -625,19 +694,21 @@ DataTable.defaults = {
|
|||||||
* elements have been inserted), or registered if using a DOM source, allowing
|
* elements have been inserted), or registered if using a DOM source, allowing
|
||||||
* manipulation of the TR element (adding classes etc).
|
* manipulation of the TR element (adding classes etc).
|
||||||
* @type function
|
* @type function
|
||||||
* @param {node} nRow "TR" element for the current row
|
* @param {node} row "TR" element for the current row
|
||||||
* @param {array} aData Raw data array for this row
|
* @param {array} data Raw data array for this row
|
||||||
* @param {int} iDataIndex The index of this row in aoData
|
* @param {int} dataIndex The index of this row in the internal aoData array
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.createdRow
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnCreatedRow": function( nRow, aData, iDataIndex ) {
|
* "createdRow": function( row, data, dataIndex ) {
|
||||||
* // Bold the grade for all 'A' grade browsers
|
* // Bold the grade for all 'A' grade browsers
|
||||||
* if ( aData[4] == "A" )
|
* if ( data[4] == "A" )
|
||||||
* {
|
* {
|
||||||
* $('td:eq(4)', nRow).html( '<b>A</b>' );
|
* $('td:eq(4)', row).html( '<b>A</b>' );
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -650,13 +721,15 @@ DataTable.defaults = {
|
|||||||
* This function is called on every 'draw' event, and allows you to
|
* This function is called on every 'draw' event, and allows you to
|
||||||
* dynamically modify any aspect you want about the created DOM.
|
* dynamically modify any aspect you want about the created DOM.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.drawCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnDrawCallback": function( oSettings ) {
|
* "fnDrawCallback": function( settings ) {
|
||||||
* alert( 'DataTables has redrawn the table' );
|
* alert( 'DataTables has redrawn the table' );
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -669,21 +742,23 @@ DataTable.defaults = {
|
|||||||
* Identical to fnHeaderCallback() but for the table footer this function
|
* Identical to fnHeaderCallback() but for the table footer this function
|
||||||
* allows you to modify the table footer on every 'draw' even.
|
* allows you to modify the table footer on every 'draw' even.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {node} nFoot "TR" element for the footer
|
* @param {node} foot "TR" element for the footer
|
||||||
* @param {array} aData Full table data (as derived from the original HTML)
|
* @param {array} data Full table data (as derived from the original HTML)
|
||||||
* @param {int} iStart Index for the current display starting point in the
|
* @param {int} start Index for the current display starting point in the
|
||||||
* display array
|
* display array
|
||||||
* @param {int} iEnd Index for the current display ending point in the
|
* @param {int} end Index for the current display ending point in the
|
||||||
* display array
|
* display array
|
||||||
* @param {array int} aiDisplay Index array to translate the visual position
|
* @param {array int} display Index array to translate the visual position
|
||||||
* to the full data array
|
* to the full data array
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.footerCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnFooterCallback": function( nFoot, aData, iStart, iEnd, aiDisplay ) {
|
* "footerCallback": function( foot, data, start, end, display ) {
|
||||||
* nFoot.getElementsByTagName('th')[0].innerHTML = "Starting index is "+iStart;
|
* foot.getElementsByTagName('th')[0].innerHTML = "Starting index is "+start;
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
@ -699,19 +774,21 @@ DataTable.defaults = {
|
|||||||
* function will override the default method DataTables uses.
|
* function will override the default method DataTables uses.
|
||||||
* @type function
|
* @type function
|
||||||
* @member
|
* @member
|
||||||
* @param {int} iIn number to be formatted
|
* @param {int} toFormat number to be formatted
|
||||||
* @returns {string} formatted string for DataTables to show the number
|
* @returns {string} formatted string for DataTables to show the number
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.formatNumber
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnFormatNumber": function ( iIn ) {
|
* "formatNumber": function ( toFormat ) {
|
||||||
* if ( iIn < 1000 ) {
|
* if ( toFormat < 1000 ) {
|
||||||
* return iIn;
|
* return toFormat;
|
||||||
* } else {
|
* } else {
|
||||||
* var
|
* var
|
||||||
* s=(iIn+""),
|
* s=(toFormat+""),
|
||||||
* a=s.split(""), out="",
|
* a=s.split(""), out="",
|
||||||
* iLen=s.length;
|
* iLen=s.length;
|
||||||
*
|
*
|
||||||
@ -727,20 +804,20 @@ DataTable.defaults = {
|
|||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"fnFormatNumber": function ( iIn ) {
|
"fnFormatNumber": function ( toFormat ) {
|
||||||
if ( iIn < 1000 )
|
if ( toFormat < 1000 )
|
||||||
{
|
{
|
||||||
// A small optimisation for what is likely to be the majority of use cases
|
// A small optimisation for what is likely to be the majority of use cases
|
||||||
return iIn;
|
return toFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
var s=(iIn+""), a=s.split(""), out="", iLen=s.length;
|
var s=(toFormat+""), a=s.split(""), out="", iLen=s.length;
|
||||||
|
|
||||||
for ( var i=0 ; i<iLen ; i++ )
|
for ( var i=0 ; i<iLen ; i++ )
|
||||||
{
|
{
|
||||||
if ( i%3 === 0 && i !== 0 )
|
if ( i%3 === 0 && i !== 0 )
|
||||||
{
|
{
|
||||||
out = this.oLanguage.sInfoThousands+out;
|
out = this.language.infoThousands+out;
|
||||||
}
|
}
|
||||||
out = a[iLen-i-1]+out;
|
out = a[iLen-i-1]+out;
|
||||||
}
|
}
|
||||||
@ -753,21 +830,23 @@ DataTable.defaults = {
|
|||||||
* dynamically modify the header row. This can be used to calculate and
|
* dynamically modify the header row. This can be used to calculate and
|
||||||
* display useful information about the table.
|
* display useful information about the table.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {node} nHead "TR" element for the header
|
* @param {node} head "TR" element for the header
|
||||||
* @param {array} aData Full table data (as derived from the original HTML)
|
* @param {array} data Full table data (as derived from the original HTML)
|
||||||
* @param {int} iStart Index for the current display starting point in the
|
* @param {int} start Index for the current display starting point in the
|
||||||
* display array
|
* display array
|
||||||
* @param {int} iEnd Index for the current display ending point in the
|
* @param {int} end Index for the current display ending point in the
|
||||||
* display array
|
* display array
|
||||||
* @param {array int} aiDisplay Index array to translate the visual position
|
* @param {array int} display Index array to translate the visual position
|
||||||
* to the full data array
|
* to the full data array
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.headerCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnHeaderCallback": function( nHead, aData, iStart, iEnd, aiDisplay ) {
|
* "fheaderCallback": function( head, data, start, end, display ) {
|
||||||
* nHead.getElementsByTagName('th')[0].innerHTML = "Displaying "+(iEnd-iStart)+" records";
|
* head.getElementsByTagName('th')[0].innerHTML = "Displaying "+(end-start)+" records";
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
@ -783,20 +862,22 @@ DataTable.defaults = {
|
|||||||
* allows you to do exactly that.
|
* allows you to do exactly that.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} oSettings DataTables settings object
|
||||||
* @param {int} iStart Starting position in data for the draw
|
* @param {int} start Starting position in data for the draw
|
||||||
* @param {int} iEnd End position in data for the draw
|
* @param {int} end End position in data for the draw
|
||||||
* @param {int} iMax Total number of rows in the table (regardless of
|
* @param {int} max Total number of rows in the table (regardless of
|
||||||
* filtering)
|
* filtering)
|
||||||
* @param {int} iTotal Total number of rows in the data set, after filtering
|
* @param {int} total Total number of rows in the data set, after filtering
|
||||||
* @param {string} sPre The string that DataTables has formatted using it's
|
* @param {string} pre The string that DataTables has formatted using it's
|
||||||
* own rules
|
* own rules
|
||||||
* @returns {string} The string to be displayed in the information element.
|
* @returns {string} The string to be displayed in the information element.
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.infoCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnInfoCallback": function( oSettings, iStart, iEnd, iMax, iTotal, sPre ) {
|
* "infoCallback": function( settings, start, end, nax, total, pre ) {
|
||||||
* return iStart +" to "+ iEnd;
|
* return start +" to "+ end;
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -809,15 +890,17 @@ DataTable.defaults = {
|
|||||||
* however, this does not hold true when using external language information
|
* however, this does not hold true when using external language information
|
||||||
* since that is obtained using an async XHR call.
|
* since that is obtained using an async XHR call.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @param {object} json The JSON object request from the server - only
|
* @param {object} json The JSON object request from the server - only
|
||||||
* present if client-side Ajax sourced data is used
|
* present if client-side Ajax sourced data is used
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.initComplete
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnInitComplete": function(oSettings, json) {
|
* "initComplete": function(settings, json) {
|
||||||
* alert( 'DataTables has finished its initialisation.' );
|
* alert( 'DataTables has finished its initialisation.' );
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -831,15 +914,17 @@ DataTable.defaults = {
|
|||||||
* draw by returning false, any other return (including undefined) results in
|
* draw by returning false, any other return (including undefined) results in
|
||||||
* the full draw occurring).
|
* the full draw occurring).
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @returns {boolean} False will cancel the draw, anything else (including no
|
* @returns {boolean} False will cancel the draw, anything else (including no
|
||||||
* return) will allow it to complete.
|
* return) will allow it to complete.
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.preDrawCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnPreDrawCallback": function( oSettings ) {
|
* "preDrawCallback": function( settings ) {
|
||||||
* if ( $('#test').val() == 1 ) {
|
* if ( $('#test').val() == 1 ) {
|
||||||
* return false;
|
* return false;
|
||||||
* }
|
* }
|
||||||
@ -855,21 +940,22 @@ DataTable.defaults = {
|
|||||||
* generated for each table draw, but before it is rendered on screen. This
|
* generated for each table draw, but before it is rendered on screen. This
|
||||||
* function might be used for setting the row class name etc.
|
* function might be used for setting the row class name etc.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {node} nRow "TR" element for the current row
|
* @param {node} row "TR" element for the current row
|
||||||
* @param {array} aData Raw data array for this row
|
* @param {array} data Raw data array for this row
|
||||||
* @param {int} iDisplayIndex The display index for the current table draw
|
* @param {int} displayIndex The display index for the current table draw
|
||||||
* @param {int} iDisplayIndexFull The index of the data in the full list of
|
* @param {int} displayIndexFull The index of the data in the full list of
|
||||||
* rows (after filtering)
|
* rows (after filtering)
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.rowCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
* "rowCallback": function( row, data, displayIndex, displayIndexFull ) {
|
||||||
* // Bold the grade for all 'A' grade browsers
|
* // Bold the grade for all 'A' grade browsers
|
||||||
* if ( aData[4] == "A" )
|
* if ( data[4] == "A" ) {
|
||||||
* {
|
* $('td:eq(4)', row).html( '<b>A</b>' );
|
||||||
* $('td:eq(4)', nRow).html( '<b>A</b>' );
|
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -880,57 +966,60 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This parameter allows you to override the default function which obtains
|
* This parameter allows you to override the default function which obtains
|
||||||
* the data from the server ($.getJSON) so something more suitable for your
|
* the data from the server so something more suitable for your application. For
|
||||||
* application. For example you could use POST data, or pull information from
|
* example you could use POST data, or pull information from a Gears or AIR
|
||||||
* a Gears or AIR database.
|
* database.
|
||||||
* @type function
|
* @type function
|
||||||
* @member
|
* @member
|
||||||
* @param {string} sSource HTTP source to obtain the data from (sAjaxSource)
|
* @param {string} source HTTP source to obtain the data from (`ajaxSource`)
|
||||||
* @param {array} aoData A key/value pair object containing the data to send
|
* @param {array} data A key/value pair object containing the data to send
|
||||||
* to the server
|
* to the server
|
||||||
* @param {function} fnCallback to be called on completion of the data get
|
* @param {function} callback to be called on completion of the data get
|
||||||
* process that will draw the data on the page.
|
* process that will draw the data on the page.
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.serverData
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // POST data to server
|
* // POST data to server (note you can use `serverMethod` to set the
|
||||||
|
* // HTTP method is that is all you want to use `serverData` for.
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bProcessing": true,
|
* "processing": true,
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "xhr.php",
|
* "ajaxSource": "xhr.php",
|
||||||
* "fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
|
* "serverData": function ( source, data, callback, settings ) {
|
||||||
* oSettings.jqXHR = $.ajax( {
|
* settings.jqXHR = $.ajax( {
|
||||||
* "dataType": 'json',
|
* "dataType": 'json',
|
||||||
* "type": "POST",
|
* "type": "POST",
|
||||||
* "url": sSource,
|
* "url": source,
|
||||||
* "data": aoData,
|
* "data": data,
|
||||||
* "success": fnCallback
|
* "success": callback
|
||||||
* } );
|
* } );
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"fnServerData": function ( sUrl, aoData, fnCallback, oSettings ) {
|
"fnServerData": function ( url, data, callback, settings ) {
|
||||||
oSettings.jqXHR = $.ajax( {
|
settings.jqXHR = $.ajax( {
|
||||||
"url": sUrl,
|
"url": url,
|
||||||
"data": aoData,
|
"data": data,
|
||||||
"success": function (json) {
|
"success": function (json) {
|
||||||
if ( json.sError ) {
|
if ( json.sError ) {
|
||||||
oSettings.oApi._fnLog( oSettings, 0, json.sError );
|
settings.oApi._fnLog( settings, 0, json.sError );
|
||||||
}
|
}
|
||||||
|
|
||||||
$(oSettings.oInstance).trigger('xhr', [oSettings, json]);
|
$(oSettings.oInstance).trigger('xhr', [settings, json]);
|
||||||
fnCallback( json );
|
callback( json );
|
||||||
},
|
},
|
||||||
"dataType": "json",
|
"dataType": "json",
|
||||||
"cache": false,
|
"cache": false,
|
||||||
"type": oSettings.sServerMethod,
|
"type": settings.sServerMethod,
|
||||||
"error": function (xhr, error, thrown) {
|
"error": function (xhr, error, thrown) {
|
||||||
if ( error == "parsererror" ) {
|
if ( error == "parsererror" ) {
|
||||||
oSettings.oApi._fnLog( oSettings, 0, "DataTables warning: JSON data from "+
|
settings.oApi._fnLog( settings, 0, "DataTables warning: JSON data from "+
|
||||||
"server could not be parsed. This is caused by a JSON formatting error." );
|
"server could not be parsed. This is caused by a JSON formatting error." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -945,24 +1034,26 @@ DataTable.defaults = {
|
|||||||
* passed in parameter is the data set that has been constructed by
|
* passed in parameter is the data set that has been constructed by
|
||||||
* DataTables, and you can add to this or modify it as you require.
|
* DataTables, and you can add to this or modify it as you require.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {array} aoData Data array (array of objects which are name/value
|
* @param {array} data Data array (array of objects which are name/value
|
||||||
* pairs) that has been constructed by DataTables and will be sent to the
|
* pairs) that has been constructed by DataTables and will be sent to the
|
||||||
* server. In the case of Ajax sourced data with server-side processing
|
* server. In the case of Ajax sourced data with server-side processing
|
||||||
* this will be an empty array, for server-side processing there will be a
|
* this will be an empty array, for server-side processing there will be a
|
||||||
* significant number of parameters!
|
* significant number of parameters!
|
||||||
* @returns {undefined} Ensure that you modify the aoData array passed in,
|
* @returns {undefined} Ensure that you modify the data array passed in,
|
||||||
* as this is passed by reference.
|
* as this is passed by reference.
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.serverParams
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bProcessing": true,
|
* "processing": true,
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "scripts/server_processing.php",
|
* "ajaxSource": "scripts/server_processing.php",
|
||||||
* "fnServerParams": function ( aoData ) {
|
* "serverParams": function ( data ) {
|
||||||
* aoData.push( { "name": "more_data", "value": "my_value" } );
|
* data.push( { "name": "more_data", "value": "my_value" } );
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -976,15 +1067,17 @@ DataTable.defaults = {
|
|||||||
* cookie, but you might wish to use local storage (HTML5) or a server-side database.
|
* cookie, but you might wish to use local storage (HTML5) or a server-side database.
|
||||||
* @type function
|
* @type function
|
||||||
* @member
|
* @member
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @return {object} The DataTables state object to be loaded
|
* @return {object} The DataTables state object to be loaded
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.stateLoadCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateLoad": function (oSettings) {
|
* "stateLoadCallback": function (settings) {
|
||||||
* var o;
|
* var o;
|
||||||
*
|
*
|
||||||
* // Send an Ajax request to the server to get the data. Note that
|
* // Send an Ajax request to the server to get the data. Note that
|
||||||
@ -1003,8 +1096,8 @@ DataTable.defaults = {
|
|||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"fnStateLoad": function ( oSettings ) {
|
"fnStateLoadCallback": function ( settings ) {
|
||||||
var sData = this.oApi._fnReadCookie( oSettings.sCookiePrefix+oSettings.sInstance );
|
var sData = this.oApi._fnReadCookie( settings.sCookiePrefix+settings.sInstance );
|
||||||
var oData;
|
var oData;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1022,20 +1115,22 @@ DataTable.defaults = {
|
|||||||
* Callback which allows modification of the saved state prior to loading that state.
|
* Callback which allows modification of the saved state prior to loading that state.
|
||||||
* This callback is called when the table is loading state from the stored data, but
|
* This callback is called when the table is loading state from the stored data, but
|
||||||
* prior to the settings object being modified by the saved state. Note that for
|
* prior to the settings object being modified by the saved state. Note that for
|
||||||
* plug-in authors, you should use the 'stateLoadParams' event to load parameters for
|
* plug-in authors, you should use the `stateLoadParams` event to load parameters for
|
||||||
* a plug-in.
|
* a plug-in.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @param {object} oData The state object that is to be loaded
|
* @param {object} data The state object that is to be loaded
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.stateLoadParams
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Remove a saved filter, so filtering is never loaded
|
* // Remove a saved filter, so filtering is never loaded
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateLoadParams": function (oSettings, oData) {
|
* "stateLoadParams": function (settings, data) {
|
||||||
* oData.oSearch.sSearch = "";
|
* data.oSearch.sSearch = "";
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1044,8 +1139,8 @@ DataTable.defaults = {
|
|||||||
* // Disallow state loading by returning false
|
* // Disallow state loading by returning false
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateLoadParams": function (oSettings, oData) {
|
* "stateLoadParams": function (settings, data) {
|
||||||
* return false;
|
* return false;
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -1058,17 +1153,19 @@ DataTable.defaults = {
|
|||||||
* Callback that is called when the state has been loaded from the state saving method
|
* Callback that is called when the state has been loaded from the state saving method
|
||||||
* and the DataTables settings object has been modified as a result of the loaded state.
|
* and the DataTables settings object has been modified as a result of the loaded state.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @param {object} oData The state object that was loaded
|
* @param {object} data The state object that was loaded
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.stateLoaded
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Show an alert with the filtering value that was saved
|
* // Show an alert with the filtering value that was saved
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateLoaded": function (oSettings, oData) {
|
* "stateLoaded": function (settings, data) {
|
||||||
* alert( 'Saved filter was: '+oData.oSearch.sSearch );
|
* alert( 'Saved filter was: '+data.oSearch.sSearch );
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1082,19 +1179,21 @@ DataTable.defaults = {
|
|||||||
* might want to use local storage (HTML5) or a server-side database.
|
* might want to use local storage (HTML5) or a server-side database.
|
||||||
* @type function
|
* @type function
|
||||||
* @member
|
* @member
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @param {object} oData The state object to be saved
|
* @param {object} data The state object to be saved
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.stateSaveCallback
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateSave": function (oSettings, oData) {
|
* "stateSaveCallback": function (settings, data) {
|
||||||
* // Send an Ajax request to the server with the state object
|
* // Send an Ajax request to the server with the state object
|
||||||
* $.ajax( {
|
* $.ajax( {
|
||||||
* "url": "/state_save",
|
* "url": "/state_save",
|
||||||
* "data": oData,
|
* "data": data,
|
||||||
* "dataType": "json",
|
* "dataType": "json",
|
||||||
* "method": "POST"
|
* "method": "POST"
|
||||||
* "success": function () {}
|
* "success": function () {}
|
||||||
@ -1103,13 +1202,13 @@ DataTable.defaults = {
|
|||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"fnStateSave": function ( oSettings, oData ) {
|
"fnStateSaveCallback": function ( settings, data ) {
|
||||||
this.oApi._fnCreateCookie(
|
this.oApi._fnCreateCookie(
|
||||||
oSettings.sCookiePrefix+oSettings.sInstance,
|
settings.sCookiePrefix+settings.sInstance,
|
||||||
this.oApi._fnJsonString(oData),
|
this.oApi._fnJsonString(data),
|
||||||
oSettings.iCookieDuration,
|
settings.iCookieDuration,
|
||||||
oSettings.sCookiePrefix,
|
settings.sCookiePrefix,
|
||||||
oSettings.fnCookieCallback
|
settings.fnCookieCallback
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1119,19 +1218,21 @@ DataTable.defaults = {
|
|||||||
* has changed state a new state save is required. This method allows modification of
|
* has changed state a new state save is required. This method allows modification of
|
||||||
* the state saving object prior to actually doing the save, including addition or
|
* the state saving object prior to actually doing the save, including addition or
|
||||||
* other state properties or modification. Note that for plug-in authors, you should
|
* other state properties or modification. Note that for plug-in authors, you should
|
||||||
* use the 'stateSaveParams' event to save parameters for a plug-in.
|
* use the `stateSaveParams` event to save parameters for a plug-in.
|
||||||
* @type function
|
* @type function
|
||||||
* @param {object} oSettings DataTables settings object
|
* @param {object} settings DataTables settings object
|
||||||
* @param {object} oData The state object to be saved
|
* @param {object} data The state object to be saved
|
||||||
|
*
|
||||||
* @dtopt Callbacks
|
* @dtopt Callbacks
|
||||||
|
* @name DataTable.defaults.stateSaveParams
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Remove a saved filter, so filtering is never saved
|
* // Remove a saved filter, so filtering is never saved
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bStateSave": true,
|
* "stateSave": true,
|
||||||
* "fnStateSaveParams": function (oSettings, oData) {
|
* "stateSaveParams": function (settings, data) {
|
||||||
* oData.oSearch.sSearch = "";
|
* data.oSearch.sSearch = "";
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1144,22 +1245,24 @@ DataTable.defaults = {
|
|||||||
* value is given in seconds.
|
* value is given in seconds.
|
||||||
* @type int
|
* @type int
|
||||||
* @default 7200 <i>(2 hours)</i>
|
* @default 7200 <i>(2 hours)</i>
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.cookieDuration
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "iCookieDuration": 60*60*24; // 1 day
|
* "cookieDuration": 60*60*24; // 1 day
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
"iCookieDuration": 7200,
|
"fnCookieDuration": 7200,
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When enabled DataTables will not make a request to the server for the first
|
* When enabled DataTables will not make a request to the server for the first
|
||||||
* page draw - rather it will use the data already on the page (no sorting etc
|
* page draw - rather it will use the data already on the page (no sorting etc
|
||||||
* will be applied to it), thus saving on an XHR at load time. iDeferLoading
|
* will be applied to it), thus saving on an XHR at load time. `deferLoading`
|
||||||
* is used to indicate that deferred loading is required, but it is also used
|
* is used to indicate that deferred loading is required, but it is also used
|
||||||
* to tell DataTables how many records there are in the full table (allowing
|
* to tell DataTables how many records there are in the full table (allowing
|
||||||
* the information element and pagination to be displayed correctly). In the case
|
* the information element and pagination to be displayed correctly). In the case
|
||||||
@ -1170,15 +1273,17 @@ DataTable.defaults = {
|
|||||||
* to be shown correctly).
|
* to be shown correctly).
|
||||||
* @type int | array
|
* @type int | array
|
||||||
* @default null
|
* @default null
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.deferLoading
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // 57 records available in the table, no filtering applied
|
* // 57 records available in the table, no filtering applied
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "scripts/server_processing.php",
|
* "ajaxSource": "scripts/server_processing.php",
|
||||||
* "iDeferLoading": 57
|
* "deferLoading": 57
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
@ -1186,30 +1291,32 @@ DataTable.defaults = {
|
|||||||
* // 57 records after filtering, 100 without filtering (an initial filter applied)
|
* // 57 records after filtering, 100 without filtering (an initial filter applied)
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "scripts/server_processing.php",
|
* "ajaxSource": "scripts/server_processing.php",
|
||||||
* "iDeferLoading": [ 57, 100 ],
|
* "deferLoading": [ 57, 100 ],
|
||||||
* "oSearch": {
|
* "search": {
|
||||||
* "sSearch": "my_filter"
|
* "search": "my_filter"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"iDeferLoading": null,
|
"bDeferLoading": null,
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number of rows to display on a single page when using pagination. If
|
* Number of rows to display on a single page when using pagination. If
|
||||||
* feature enabled (bLengthChange) then the end user will be able to override
|
* feature enabled (`lengthChange`) then the end user will be able to override
|
||||||
* this to a custom setting using a pop-up menu.
|
* this to a custom setting using a pop-up menu.
|
||||||
* @type int
|
* @type int
|
||||||
* @default 10
|
* @default 10
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.displayLength
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "iDisplayLength": 50
|
* "displayLength": 50
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -1223,12 +1330,14 @@ DataTable.defaults = {
|
|||||||
* the third page, it should be "20".
|
* the third page, it should be "20".
|
||||||
* @type int
|
* @type int
|
||||||
* @default 0
|
* @default 0
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.displayStart
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "iDisplayStart": 20
|
* "displayStart": 20
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -1237,20 +1346,23 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The scroll gap is the amount of scrolling that is left to go before
|
* The scroll gap is the amount of scrolling that is left to go before
|
||||||
* DataTables will load the next 'page' of data automatically. You typically
|
* DataTables will load the next 'page' of data automatically when using
|
||||||
* want a gap which is big enough that the scrolling will be smooth for the
|
* `scrollInfinite`. You typically want a gap which is big enough that the
|
||||||
* user, while not so large that it will load more data than need.
|
* scrolling will be smooth for the user, while not so large that it will
|
||||||
|
* load more data than need.
|
||||||
* @type int
|
* @type int
|
||||||
* @default 100
|
* @default 100
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.scrollLoadGap
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bScrollInfinite": true,
|
* "scrollInfinite": true,
|
||||||
* "bScrollCollapse": true,
|
* "scrollCollapse": true,
|
||||||
* "sScrollY": "200px",
|
* "scrollY": "200px",
|
||||||
* "iScrollLoadGap": 50
|
* "scrollLoadGap": 50
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -1259,19 +1371,21 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* By default DataTables allows keyboard navigation of the table (sorting, paging,
|
* By default DataTables allows keyboard navigation of the table (sorting, paging,
|
||||||
* and filtering) by adding a tabindex attribute to the required elements. This
|
* and filtering) by adding a `tabindex` attribute to the required elements. This
|
||||||
* allows you to tab through the controls and press the enter key to activate them.
|
* allows you to tab through the controls and press the enter key to activate them.
|
||||||
* The tabindex is default 0, meaning that the tab follows the flow of the document.
|
* The tabindex is default 0, meaning that the tab follows the flow of the document.
|
||||||
* You can overrule this using this parameter if you wish. Use a value of -1 to
|
* You can overrule this using this parameter if you wish. Use a value of -1 to
|
||||||
* disable built-in keyboard navigation.
|
* disable built-in keyboard navigation.
|
||||||
* @type int
|
* @type int
|
||||||
* @default 0
|
* @default 0
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.tabIndex
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "iTabIndex": 1
|
* "tabIndex": 1
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -1283,6 +1397,7 @@ DataTable.defaults = {
|
|||||||
* are defined in this object, allowing you to modified them individually or
|
* are defined in this object, allowing you to modified them individually or
|
||||||
* completely replace them all as required.
|
* completely replace them all as required.
|
||||||
* @namespace
|
* @namespace
|
||||||
|
* @name DataTable.defaults.language
|
||||||
*/
|
*/
|
||||||
"oLanguage": {
|
"oLanguage": {
|
||||||
/**
|
/**
|
||||||
@ -1290,6 +1405,7 @@ DataTable.defaults = {
|
|||||||
* actually visible on the page, but will be read by screenreaders, and thus
|
* actually visible on the page, but will be read by screenreaders, and thus
|
||||||
* must be internationalised as well).
|
* must be internationalised as well).
|
||||||
* @namespace
|
* @namespace
|
||||||
|
* @name DataTable.defaults.language.aria
|
||||||
*/
|
*/
|
||||||
"oAria": {
|
"oAria": {
|
||||||
/**
|
/**
|
||||||
@ -1298,14 +1414,16 @@ DataTable.defaults = {
|
|||||||
* Note that the column header is prefixed to this string.
|
* Note that the column header is prefixed to this string.
|
||||||
* @type string
|
* @type string
|
||||||
* @default : activate to sort column ascending
|
* @default : activate to sort column ascending
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.aria.sortAscending
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oAria": {
|
* "aria": {
|
||||||
* "sSortAscending": " - click/return to sort ascending"
|
* "sortAscending": " - click/return to sort ascending"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -1319,14 +1437,16 @@ DataTable.defaults = {
|
|||||||
* Note that the column header is prefixed to this string.
|
* Note that the column header is prefixed to this string.
|
||||||
* @type string
|
* @type string
|
||||||
* @default : activate to sort column ascending
|
* @default : activate to sort column ascending
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.aria.sortDescending
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oAria": {
|
* "aria": {
|
||||||
* "sSortDescending": " - click/return to sort descending"
|
* "sortDescending": " - click/return to sort descending"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -1339,6 +1459,7 @@ DataTable.defaults = {
|
|||||||
* Pagination string used by DataTables for the two built-in pagination
|
* Pagination string used by DataTables for the two built-in pagination
|
||||||
* control types ("two_button" and "full_numbers")
|
* control types ("two_button" and "full_numbers")
|
||||||
* @namespace
|
* @namespace
|
||||||
|
* @name DataTable.defaults.language.paginate
|
||||||
*/
|
*/
|
||||||
"oPaginate": {
|
"oPaginate": {
|
||||||
/**
|
/**
|
||||||
@ -1346,14 +1467,16 @@ DataTable.defaults = {
|
|||||||
* button to take the user to the first page.
|
* button to take the user to the first page.
|
||||||
* @type string
|
* @type string
|
||||||
* @default First
|
* @default First
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.paginate.first
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oPaginate": {
|
* "paginate": {
|
||||||
* "sFirst": "First page"
|
* "first": "First page"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -1367,14 +1490,16 @@ DataTable.defaults = {
|
|||||||
* button to take the user to the last page.
|
* button to take the user to the last page.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Last
|
* @default Last
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.paginate.last
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oPaginate": {
|
* "paginate": {
|
||||||
* "sLast": "Last page"
|
* "last": "Last page"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -1388,14 +1513,16 @@ DataTable.defaults = {
|
|||||||
* next page).
|
* next page).
|
||||||
* @type string
|
* @type string
|
||||||
* @default Next
|
* @default Next
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.paginate.next
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oPaginate": {
|
* "paginate": {
|
||||||
* "sNext": "Next page"
|
* "next": "Next page"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -1409,14 +1536,16 @@ DataTable.defaults = {
|
|||||||
* the previous page).
|
* the previous page).
|
||||||
* @type string
|
* @type string
|
||||||
* @default Previous
|
* @default Previous
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.paginate.previous
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "oPaginate": {
|
* "paginate": {
|
||||||
* "sPrevious": "Previous page"
|
* "previous": "Previous page"
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
@ -1426,19 +1555,21 @@ DataTable.defaults = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This string is shown in preference to sZeroRecords when the table is
|
* This string is shown in preference to `zeroRecords` when the table is
|
||||||
* empty of data (regardless of filtering). Note that this is an optional
|
* empty of data (regardless of filtering). Note that this is an optional
|
||||||
* parameter - if it is not given, the value of sZeroRecords will be used
|
* parameter - if it is not given, the value of `zeroRecords` will be used
|
||||||
* instead (either the default or given value).
|
* instead (either the default or given value).
|
||||||
* @type string
|
* @type string
|
||||||
* @default No data available in table
|
* @default No data available in table
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.emptyTable
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sEmptyTable": "No data available in table"
|
* "emptyTable": "No data available in table"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1453,13 +1584,15 @@ DataTable.defaults = {
|
|||||||
* can be freely moved or removed as the language requirements change.
|
* can be freely moved or removed as the language requirements change.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Showing _START_ to _END_ of _TOTAL_ entries
|
* @default Showing _START_ to _END_ of _TOTAL_ entries
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.info
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sInfo": "Got a total of _TOTAL_ entries to show (_START_ to _END_)"
|
* "info": "Got a total of _TOTAL_ entries to show (_START_ to _END_)"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1469,16 +1602,18 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Display information string for when the table is empty. Typically the
|
* Display information string for when the table is empty. Typically the
|
||||||
* format of this string should match sInfo.
|
* format of this string should match `info`.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Showing 0 to 0 of 0 entries
|
* @default Showing 0 to 0 of 0 entries
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.infoEmpty
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sInfoEmpty": "No entries to show"
|
* "infoEmpty": "No entries to show"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1488,17 +1623,19 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When a user filters the information in a table, this string is appended
|
* When a user filters the information in a table, this string is appended
|
||||||
* to the information (sInfo) to give an idea of how strong the filtering
|
* to the information (`info`) to give an idea of how strong the filtering
|
||||||
* is. The variable _MAX_ is dynamically updated.
|
* is. The variable _MAX_ is dynamically updated.
|
||||||
* @type string
|
* @type string
|
||||||
* @default (filtered from _MAX_ total entries)
|
* @default (filtered from _MAX_ total entries)
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.infoFiltered
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sInfoFiltered": " - filtering from _MAX_ records"
|
* "infoFiltered": " - filtering from _MAX_ records"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1509,17 +1646,19 @@ DataTable.defaults = {
|
|||||||
/**
|
/**
|
||||||
* If can be useful to append extra information to the info string at times,
|
* If can be useful to append extra information to the info string at times,
|
||||||
* and this variable does exactly that. This information will be appended to
|
* and this variable does exactly that. This information will be appended to
|
||||||
* the sInfo (sInfoEmpty and sInfoFiltered in whatever combination they are
|
* the `info` (`infoEmpty` and `infoFiltered` in whatever combination they are
|
||||||
* being used) at all times.
|
* being used) at all times.
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>Empty string</i>
|
* @default <i>Empty string</i>
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.infoPostFix
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sInfoPostFix": "All records shown are derived from real information."
|
* "infoPostFix": "All records shown are derived from real information."
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1528,19 +1667,21 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DataTables has a build in number formatter (fnFormatNumber) which is used
|
* DataTables has a build in number formatter (`formatNumber`) which is used
|
||||||
* to format large numbers that are used in the table information. By
|
* to format large numbers that are used in the table information. By
|
||||||
* default a comma is used, but this can be trivially changed to any
|
* default a comma is used, but this can be trivially changed to any
|
||||||
* character you wish with this parameter.
|
* character you wish with this parameter.
|
||||||
* @type string
|
* @type string
|
||||||
* @default ,
|
* @default ,
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.infoThousands
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sInfoThousands": "'"
|
* "infoThousands": "'"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1555,14 +1696,16 @@ DataTable.defaults = {
|
|||||||
* with a custom select box if required.
|
* with a custom select box if required.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Show _MENU_ entries
|
* @default Show _MENU_ entries
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.lengthMenu
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Language change only
|
* // Language change only
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sLengthMenu": "Display _MENU_ records"
|
* "lengthMenu": "Display _MENU_ records"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1571,8 +1714,8 @@ DataTable.defaults = {
|
|||||||
* // Language and options change
|
* // Language and options change
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sLengthMenu": 'Display <select>'+
|
* "lengthMenu": 'Display <select>'+
|
||||||
* '<option value="10">10</option>'+
|
* '<option value="10">10</option>'+
|
||||||
* '<option value="20">20</option>'+
|
* '<option value="20">20</option>'+
|
||||||
* '<option value="30">30</option>'+
|
* '<option value="30">30</option>'+
|
||||||
@ -1595,13 +1738,15 @@ DataTable.defaults = {
|
|||||||
* Ajax sourced data with client-side processing.
|
* Ajax sourced data with client-side processing.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Loading...
|
* @default Loading...
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.loadingRecords
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sLoadingRecords": "Please wait - loading..."
|
* "loadingRecords": "Please wait - loading..."
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1614,13 +1759,15 @@ DataTable.defaults = {
|
|||||||
* (usually a sort command or similar).
|
* (usually a sort command or similar).
|
||||||
* @type string
|
* @type string
|
||||||
* @default Processing...
|
* @default Processing...
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.processing
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sProcessing": "DataTables is currently busy"
|
* "processing": "DataTables is currently busy"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1636,14 +1783,16 @@ DataTable.defaults = {
|
|||||||
* then the input box is appended to the string automatically.
|
* then the input box is appended to the string automatically.
|
||||||
* @type string
|
* @type string
|
||||||
* @default Search:
|
* @default Search:
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.search
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Input text box will be appended at the end automatically
|
* // Input text box will be appended at the end automatically
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sSearch": "Filter records:"
|
* "search": "Filter records:"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1652,8 +1801,8 @@ DataTable.defaults = {
|
|||||||
* // Specify where the filter should appear
|
* // Specify where the filter should appear
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sSearch": "Apply filter _INPUT_ to table"
|
* "search": "Apply filter _INPUT_ to table"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1670,13 +1819,15 @@ DataTable.defaults = {
|
|||||||
* the example language files to see how this works in action.
|
* the example language files to see how this works in action.
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>Empty string - i.e. disabled</i>
|
* @default <i>Empty string - i.e. disabled</i>
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.url
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sUrl": "http://www.sprymedia.co.uk/dataTables/lang.txt"
|
* "url": "http://www.sprymedia.co.uk/dataTables/lang.txt"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1686,17 +1837,19 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Text shown inside the table records when the is no information to be
|
* Text shown inside the table records when the is no information to be
|
||||||
* displayed after filtering. sEmptyTable is shown when there is simply no
|
* displayed after filtering. `emptyTable` is shown when there is simply no
|
||||||
* information in the table at all (regardless of filtering).
|
* information in the table at all (regardless of filtering).
|
||||||
* @type string
|
* @type string
|
||||||
* @default No matching records found
|
* @default No matching records found
|
||||||
|
*
|
||||||
* @dtopt Language
|
* @dtopt Language
|
||||||
|
* @name DataTable.defaults.language.zeroRecords
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oLanguage": {
|
* "language": {
|
||||||
* "sZeroRecords": "No records to display"
|
* "zeroRecords": "No records to display"
|
||||||
* }
|
* }
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
@ -1707,20 +1860,22 @@ DataTable.defaults = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This parameter allows you to have define the global filtering state at
|
* This parameter allows you to have define the global filtering state at
|
||||||
* initialisation time. As an object the "sSearch" parameter must be
|
* initialisation time. As an object the `search` parameter must be
|
||||||
* defined, but all other parameters are optional. When "bRegex" is true,
|
* defined, but all other parameters are optional. When `regex` is true,
|
||||||
* the search string will be treated as a regular expression, when false
|
* the search string will be treated as a regular expression, when false
|
||||||
* (default) it will be treated as a straight string. When "bSmart"
|
* (default) it will be treated as a straight string. When `smart`
|
||||||
* DataTables will use it's smart filtering methods (to word match at
|
* DataTables will use it's smart filtering methods (to word match at
|
||||||
* any point in the data), when false this will not be done.
|
* any point in the data), when false this will not be done.
|
||||||
* @namespace
|
* @namespace
|
||||||
* @extends DataTable.models.oSearch
|
* @extends DataTable.models.oSearch
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.search
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "oSearch": {"sSearch": "Initial search"}
|
* "search": {"search": "Initial search"}
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -1734,15 +1889,17 @@ DataTable.defaults = {
|
|||||||
* notation to get a data source for multiple levels of nesting.
|
* notation to get a data source for multiple levels of nesting.
|
||||||
* @type string
|
* @type string
|
||||||
* @default aaData
|
* @default aaData
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.ajaxDataProp
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Get data from { "data": [...] }
|
* // Get data from { "data": [...] }
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* var oTable = $('#example').dataTable( {
|
||||||
* "sAjaxSource": "sources/data.txt",
|
* "ajaxSource": "sources/data.txt",
|
||||||
* "sAjaxDataProp": "data"
|
* "ajaxDataProp": "data"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*
|
*
|
||||||
@ -1750,8 +1907,8 @@ DataTable.defaults = {
|
|||||||
* // Get data from { "data": { "inner": [...] } }
|
* // Get data from { "data": { "inner": [...] } }
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* var oTable = $('#example').dataTable( {
|
* var oTable = $('#example').dataTable( {
|
||||||
* "sAjaxSource": "sources/data.txt",
|
* "ajaxSource": "sources/data.txt",
|
||||||
* "sAjaxDataProp": "data.inner"
|
* "ajaxDataProp": "data.inner"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -1762,16 +1919,18 @@ DataTable.defaults = {
|
|||||||
* You can instruct DataTables to load data from an external source using this
|
* You can instruct DataTables to load data from an external source using this
|
||||||
* parameter (use aData if you want to pass data in you already have). Simply
|
* parameter (use aData if you want to pass data in you already have). Simply
|
||||||
* provide a url a JSON object can be obtained from. This object must include
|
* provide a url a JSON object can be obtained from. This object must include
|
||||||
* the parameter 'aaData' which is the data source for the table.
|
* the parameter `aaData` which is the data source for the table.
|
||||||
* @type string
|
* @type string
|
||||||
* @default null
|
* @default null
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.ajaxSource
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sAjaxSource": "http://www.sprymedia.co.uk/dataTables/json.php"
|
* "ajaxSource": "/dataTables/json.php"
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -1783,12 +1942,14 @@ DataTable.defaults = {
|
|||||||
* assigns to a cookie when state saving is enabled.
|
* assigns to a cookie when state saving is enabled.
|
||||||
* @type string
|
* @type string
|
||||||
* @default SpryMedia_DataTables_
|
* @default SpryMedia_DataTables_
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.cookiePrefix
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sCookiePrefix": "my_datatable_",
|
* "cookiePrefix": "my_datatable_",
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -1833,14 +1994,16 @@ DataTable.defaults = {
|
|||||||
* </li>
|
* </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* @type string
|
* @type string
|
||||||
* @default lfrtip <i>(when bJQueryUI is false)</i> <b>or</b>
|
* @default lfrtip <i>(when `jQueryUI` is false)</i> <b>or</b>
|
||||||
* <"H"lfr>t<"F"ip> <i>(when bJQueryUI is true)</i>
|
* <"H"lfr>t<"F"ip> <i>(when `jQueryUI` is true)</i>
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.dom
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sDom": '<"top"i>rt<"bottom"flp><"clear">'
|
* "dom": '<"top"i>rt<"bottom"flp><"clear">'
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -1853,12 +2016,14 @@ DataTable.defaults = {
|
|||||||
* the end user. Further methods can be added using the API (see below).
|
* the end user. Further methods can be added using the API (see below).
|
||||||
* @type string
|
* @type string
|
||||||
* @default two_button
|
* @default two_button
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.paginationType
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sPaginationType": "full_numbers"
|
* "paginationType": "full_numbers"
|
||||||
* } );
|
* } );
|
||||||
* } )
|
* } )
|
||||||
*/
|
*/
|
||||||
@ -1873,13 +2038,15 @@ DataTable.defaults = {
|
|||||||
* as a pixel measurement).
|
* as a pixel measurement).
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>blank string - i.e. disabled</i>
|
* @default <i>blank string - i.e. disabled</i>
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.scrollX
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sScrollX": "100%",
|
* "scrollX": "100%",
|
||||||
* "bScrollCollapse": true
|
* "scrollCollapse": true
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -1895,13 +2062,15 @@ DataTable.defaults = {
|
|||||||
* measurement).
|
* measurement).
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>blank string - i.e. disabled</i>
|
* @default <i>blank string - i.e. disabled</i>
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
|
* @name DataTable.defaults.scrollXInner
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sScrollX": "100%",
|
* "scrollX": "100%",
|
||||||
* "sScrollXInner": "110%"
|
* "scrollXInner": "110%"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -1917,13 +2086,15 @@ DataTable.defaults = {
|
|||||||
* (in which case it will be treated as a pixel measurement).
|
* (in which case it will be treated as a pixel measurement).
|
||||||
* @type string
|
* @type string
|
||||||
* @default <i>blank string - i.e. disabled</i>
|
* @default <i>blank string - i.e. disabled</i>
|
||||||
|
*
|
||||||
* @dtopt Features
|
* @dtopt Features
|
||||||
|
* @name DataTable.defaults.scrollY
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "sScrollY": "200px",
|
* "scrollY": "200px",
|
||||||
* "bPaginate": false
|
* "paginate": false
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
@ -1935,18 +2106,22 @@ DataTable.defaults = {
|
|||||||
* processing or Ajax sourced data.
|
* processing or Ajax sourced data.
|
||||||
* @type string
|
* @type string
|
||||||
* @default GET
|
* @default GET
|
||||||
|
*
|
||||||
* @dtopt Options
|
* @dtopt Options
|
||||||
* @dtopt Server-side
|
* @dtopt Server-side
|
||||||
|
* @name DataTable.defaults.serverMethod
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* $(document).ready( function() {
|
* $(document).ready( function() {
|
||||||
* $('#example').dataTable( {
|
* $('#example').dataTable( {
|
||||||
* "bServerSide": true,
|
* "serverSide": true,
|
||||||
* "sAjaxSource": "scripts/post.php",
|
* "ajaxSource": "scripts/post.php",
|
||||||
* "sServerMethod": "POST"
|
* "serverMethod": "POST"
|
||||||
* } );
|
* } );
|
||||||
* } );
|
* } );
|
||||||
*/
|
*/
|
||||||
"sServerMethod": "GET"
|
"sServerMethod": "GET"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_fnHungarianMap( DataTable.defaults );
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DataTables",
|
"name": "DataTables",
|
||||||
"version": "1.9.4",
|
"version": "1.10.0.dev",
|
||||||
"title": "DataTables",
|
"title": "DataTables",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Allan Jardine",
|
"name": "Allan Jardine",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user