Lines Matching +defs:t +defs:data

37 		// jQuery's factory checks for a global window - if it isn't present then it
95 * 'original' whereby the original order the data was read into the table is used.
129 * Almost identical to $ in operation, but in this case returns the data for the matched
131 * rather than any descendants, so the data can be obtained for the row/cell. If matching
132 * rows are found, the data returned is the original data array/object that was used to
141 * @param {string} [oOpts.order=current] Order of the data in the processed array.
143 * 'original' whereby the original order the data was read into the table is used.
157 * // Get the data from the first row in the table
158 * var data = oTable._('tr:first');
160 * // Do something useful with the data
161 * alert( "First cell is: "+data[0] );
168 * // Filter to 'Webkit' and get all data for
170 * var data = oTable._('tr', {"search": "applied"});
172 * // Do something with the data
173 * alert( data.length+" rows matched the search" );
178 return this.api(true).rows( sSelector, oOpts ).data();
202 * Add a single new row or multiple rows of data to the table. Please note
204 * server-side processing (i.e. "bServerSide": true), then to add data, you
205 * must add it to the data source, i.e. the server-side, through an Ajax call.
206 * @param {array|object} data The data to be added to the table. This can be:
208 * <li>1D array of data - add a single row with the data provided</li>
210 * <li>object - data object when using <i>mData</i></li>
211 * <li>array of objects - multiple data objects when using <i>mData</i></li>
239 this.fnAddData = function( data, redraw )
244 var rows = Array.isArray(data) && ( Array.isArray(data[0]) || $.isPlainObject(data[0]) ) ?
245 api.rows.add( data ) :
246 api.row.add( data );
257 * This function will make DataTables recalculate the column sizes, based on the data
321 * @returns {int} 0 on success, or 1 if failed (can't find the row)
370 var data = settings.aoData[ rows[0][0] ];
375 callback.call( this, settings, data );
382 return data;
416 * // Re-draw the table - you wouldn't want to do it here, but it's an example :-)
422 // Note that this isn't an exact match to the old call to _fnDraw - it takes
423 // into account the new data, but can hold position.
429 * Filter the input based on data
463 * Get the data for the whole table, an individual row or an individual cell based on the
466 * a TR node then the data source for the whole row will be returned. If given as a
467 * TD/TH cell node then iCol will be automatically calculated and the data for the
469 * data index for the row (see fnGetPosition) and the data for that row used.
470 * @param {int} [col] Optional column index that you want the data of.
471 * @returns {array|object|string} If mRow is undefined, then the data for all rows is
472 * returned. If mRow is defined, just data for that row, and is iCol is
473 * defined, only data for the designated cell is returned.
478 * // Row data
483 * var data = oTable.fnGetData( this );
484 * // ... do something with the array / object of data for the row
489 * // Individual cell data
507 api.cell( src, col ).data() :
508 api.row( src ).data() || null;
511 return api.data().toArray();
556 * // Get the position of the current data from the node
559 * // Get the data array for this row
562 * // Update the data array and return the value
737 * @param {int} iCol the data index to sort on. Note that this will not match the
738 * 'display index' if you have hidden data entries
781 * an object in the same format as the original data source. The function is
805 api.row( mRow ).data( mData );
808 api.cell( mRow, iColumn ).data( mData );
891 _fnCamelToHungarian( defaults, $.extend( oInit, $this.data() ), true );
927 * initialised, but the table nodes don't match (from before) then we destroy the old
1160 return cell.getAttribute( 'data-'+name ) !== null ? name : null;
1177 sort: sort !== null ? i+'.@data-'+sort : undefined,
1178 type: sort !== null ? i+'.@data-'+sort : undefined,
1179 filter: filter !== null ? i+'.@data-'+filter : undefined
1270 /* Check if there is data passing into the constructor */
1277 /* Grab the data from the page - only do this when deferred loading or no Ajax
1278 * source since there is no point in reading the DOM data if we are then going
1279 * to replace it with Ajax data
1284 /* Copy the data index array */
1318 * DataTables functions can access them and they don't leak into global space.
1570 // but this doesn't work with arrays or objects, which we must also
1707 * setting data since we don't know the type here. This is why an object
1714 // Nothing to do when the data source is null
1718 return function (data, val, meta) {
1719 source( data, 'set', val, meta );
1725 // Like the get, we need to get data from a nested object
1726 var setData = function (data, val, src) {
1743 data[ a[i] ] = [];
1755 data[ a[i] ].push( o );
1759 // We've been asked to save data to an array, but it
1760 // isn't array data to be saved. Best that can be done
1762 data[ a[i] ] = val;
1766 // of the source and has set the data, thus we can exit here
1772 data = data[ a[i] ]( val );
1775 // If the nested object doesn't currently exist - since we are
1777 if ( data[ a[i] ] === null || data[ a[i] ] === undefined ) {
1778 data[ a[i] ] = {};
1780 data = data[ a[i] ];
1786 data = data[ aLast.replace(__reFn, '') ]( val );
1790 // and assign the value. If it isn't used, then we get the result we want anyway
1791 data[ aLast.replace(__reArray, '') ] = val;
1795 return function (data, val) { // meta is also passed in, but not used
1796 return setData( data, val, source );
1801 return function (data, val) { // meta is also passed in, but not used
1802 data[source] = val;
1822 return function (data, type, row, meta) {
1823 var t = o[type] || o._;
1824 return t !== undefined ?
1825 t(data, type, row, meta) :
1826 data;
1831 return function (data) { // type, row and meta also passed, but not used
1832 return data;
1836 return function (data, type, row, meta) {
1837 return source( data, type, row, meta );
1843 /* If there is a . in the source string then the data source is in a
1844 * nested object so we loop over the data for each level to get the next
1849 var fetchData = function (data, type, src) {
1866 data = data[ a[i] ];
1875 if ( Array.isArray( data ) ) {
1876 for ( var j=0, jLen=data.length ; j<jLen ; j++ ) {
1877 out.push( fetchData( data[j], type, innerSrc ) );
1884 data = (join==="") ? out : out.join(join);
1893 data = data[ a[i] ]();
1897 if (data === null || data[ a[i] ] === null) {
1900 else if ( data === undefined || data[ a[i] ] === undefined ) {
1904 data = data[ a[i] ];
1908 return data;
1911 return function (data, type) { // row and meta also passed, but not used
1912 return fetchData( data, type, source );
1917 return function (data, type) { // row and meta also passed, but not used
1918 return data[source];
1968 * won't be.
2004 * Language compatibility - when certain options are given, and others aren't, we
2028 defaults.sEmptyTable === "No data available in table" )
2135 // We don't need to do this every time DataTables is constructed, the values
2137 // don't expect to change between initialisations
2196 // IE8- don't provide height and width for getBoundingClientRect
2208 * Array.prototype reduce[Right] method, used for browsers which don't support
2268 _fnColumnOptions( oSettings, iCol, $(nTh).data() );
2285 // Try to get width information from the DOM. We can't get it from CSS
2292 var t = (th.attr('style') || '').match(/width:\s*(\d+[pxem%]+)/);
2293 if ( t ) {
2294 oCol.sWidthOrig = t[1];
2349 /* Cache the data get and set functions for speed */
2373 // Indicate if DataTables should read DOM data as an object or array
2383 th.addClass( oClasses.sSortableNone ); // Have to add class here as order event isn't called
2413 * Adjust the table column widths for new data. Note: you would probably want to
2443 * Convert the index of a visible column to the index in the data array (take account
2447 * @returns {int} i the data index
2461 * Convert the index of an index in the data array and convert it to the visible
2465 * @returns {int} i the data index
2528 var data = settings.aoData;
2543 for ( k=0, ken=data.length ; k<ken ; k++ ) {
2544 // Use a cache array so we only need to get the type data
2552 // If null, then this type can't apply to this column, so
2569 // Type is valid for all data points in the column - use this
2626 /* Add columns that we don't yet know about */
2667 * Add a data array to the table, creating DOM node etc. This is the parallel to
2671 * @param {array} aData data array to be added
2684 src: nTr ? 'dom' : 'data',
2695 // Invalidate the column types as the new data needs to be revalidated
2721 * use this for reading data from a DOM sourced table, but it could be
2740 return _fnAddData( settings, row.data, el, row.cells );
2759 * Take a TD element and convert it into a column data index (not the visible index)
2773 * Get the data for a given cell from the internal cache, taking into account data mapping
2777 * @param {string} type data get type ('display', 'type' 'filter|search' 'sort|order')
2778 * @returns {*} Cell data
2810 // When the data source is null and a specific data type is requested (i.e.
2811 // not the original data), we can use default column data
2816 // If the data source is a function, then we run it and use the return,
2817 // executing in the scope of the data object (for instances)
2838 * Set the value for a specific cell, into the internal data cache
2858 // Private variable that is used to match action syntax in the data property object
2876 * Return a function that can be used to get data from a source object, taking
2878 * @param {string|int|function} mSource The data source for the object
2886 * Return a function that can be used to set data from a source object, taking
2888 * @param {string|int|function} mSource The data source for the object
2896 * Return an array with the full table data
2898 * @returns array {array} aData Master data array
2952 * Mark cached data as invalid such that a re-read of the data will occur when
2953 * the cached data is next requested. Also update from the data source object.
2958 * or 'data'
2982 // Are we reading last data from DOM or the data object?
2984 // Read the data from the DOM
2988 .data;
2991 // Reading from data object, update the DOM
3006 // For both row and cell invalidation, the cached data for sorting and
3012 // the data might have changed
3029 * Build a data source object from an HTML row, reading the contents of the
3033 * @param {node|object} TR element from which to read data or existing row
3034 * object from which to re-read the data from the cells
3037 * parameter should also be given and will be used to write the data into.
3039 * @returns {object} Object with two parameters: `data` the data read, in
3054 // Allow the data object to be passed in, or construct
3073 // Read data from a cell and store into the data object
3088 // Depending on the `data` option for the columns the data can
3140 data: d,
3175 /* Special parameters can be given by the data source to be used on the row */
3234 * Add attributes to a row based on the special `DT_*` parameters in a data
3243 var data = row._aData;
3246 var id = settings.rowIdFn( data );
3252 if ( data.DT_RowClass ) {
3254 var a = data.DT_RowClass.split(' ');
3261 .addClass( data.DT_RowClass );
3264 if ( data.DT_RowAttr ) {
3265 $(tr).attr( data.DT_RowAttr );
3268 if ( data.DT_RowData ) {
3269 $(tr).data( data.DT_RowData );
3362 * aApplied array. Cell inserts in the grid will only occur where there isn't
3732 else if ( cOption == 't' )
3921 * @param {array} data Data to send to the server, required by
3923 * @param {function} fn Callback function to run when data is obtained
3925 function _fnBuildAjax( oSettings, data, fn )
3928 _fnCallbackFire( oSettings, 'aoServerParams', 'serverParams', [data] );
3932 if ( data && Array.isArray(data) ) {
3936 $.each( data, function (key, val) {
3952 data = tmp;
3979 if ( $.isPlainObject( ajax ) && ajax.data )
3981 ajaxData = ajax.data;
3984 ajaxData( data, oSettings ) : // fn can manipulate data or return
3988 data = typeof ajaxData === 'function' && newData ?
3990 $.extend( true, data, newData );
3992 // Remove the data property as we've resolved it already and don't want
3994 delete ajax.data;
3998 "data": data,
4019 // Store the data submitted for the API
4020 oSettings.oAjaxData = data;
4022 // Allow plug-ins and external processes to modify the data
4023 _fnCallbackFire( oSettings, null, 'preXhr', [oSettings, data] );
4030 $.map( data, function (val, key) { // Need to convert back to 1.9 trad format
4047 oSettings.jqXHR = ajax.call( instance, data, callback, oSettings );
4055 ajax.data = ajaxData;
4105 i, data = [], dataProp, column, columnSearch,
4113 data.push( { 'name': name, 'value': value } );
4142 data: dataProp,
4185 return settings.sAjaxSource ? data : d;
4190 return legacy ? data : d;
4195 * Data the data from the server (nuking the old) and redraw the table
4197 * @param {object} json json data return from the server.
4199 * @param {int} json.iTotalRecords Number of records in the data set, not accounting for filtering
4200 * @param {int} json.iTotalDisplayRecords Number of records in the data set, accounting for filtering
4201 * @param {array} json.aaData The data to display on this page
4213 var data = _fnAjaxDataSrc( settings, json );
4226 // No data in returned object, so rather than an array, we show an empty table
4227 if ( ! data ) {
4228 data = [];
4235 for ( var i=0, ien=data.length ; i<ien ; i++ ) {
4236 _fnAddData( settings, data[i] );
4251 * Get the data from the JSON data source to use for drawing a table. Using
4252 * `_fnGetObjectDataFn` allows the data to be sourced from a property of the
4256 * @return {array} Array of data to use
4265 if ( dataSrc === 'data' ) {
4347 // checks the value to see if it has changed. In other browsers it won't have.
4458 // So the array reference doesn't break set the results into the
4482 var data;
4488 data = settings.aoData[ display[i] ]._aFilterData[ colIdx ];
4490 if ( rpSearch.test( data ) ) {
4500 * Filter the data table based on user input and draw the table
4525 // If the input is blank - we just want the full data set
4610 // Update the filtering data for each row if needed (by invalidation or first run)
4820 /* Ensure that the table data is fully initialised */
4855 // data (show 'loading' message possibly)
4861 // if there is an ajax source load the data
4866 // Got the data - add it to the table
4901 // When data was added after the initialisation (data or Ajax) we need to
4964 // Can't use `select` variable as user might provide their own and the
5434 // - which is shouldn't. When there is a scrollbar we need to take this
5559 /* IE7< puts a vertical scrollbar in place (when it shouldn't be) due to subtracting
5561 * set the height in order to sort this. Don't want to do it in any other browsers.
5592 // only if we aren't holding the position
5702 // node in the data, assign any user defined widths, then insert it into
5705 var tmpTable = $(table).clone() // don't use cloneNode - IE8 will remove events on the main table
5713 // Clone the table header and footer - we can't use the header / footer
5761 // Tidy the temporary table - remove name attributes so there aren't
5768 // or not. Otherwise it might trigger scrolling when it actually isn't
5840 // resized. Use the width attr rather than CSS, since we can't know if the
5916 var data = settings.aoData[ idx ];
5917 return ! data.nTr ? // Might not have been created when deferred rendering
5919 data.anCells[ colIdx ];
5924 * Get the maximum strlen for each data column
6056 aDataSort, data, iCol, sType, oSort,
6063 // @todo Can this be moved into a 'data-ready' handler which is called when
6064 // data is going to be used in the table?
6077 // Load the data needed for the sort, for each cell
6090 /* Do the sort - here we want multi-column sorting based on a given data source (column)
6103 * Basically we have a test for each sorting column, if the data in that column is equal,
6105 * positions in the original data array to provide a stable sort.
6168 /* Tell the draw function that we have sorted the data */
6262 nextSortIdx = 0; // can't remove sorting completely
6317 /* If the column is not sortable - don't to anything */
6381 // Get the data to sort a column, be it from cache, fresh (populating the
6385 // Custom sorting function - provided by the sort data type
6409 customData[i] : // If there was a custom sort function, use data from there
6500 // Allow custom and plug-in manipulation functions to alter the saved data set and
6509 // Reject old data
6575 // Don't redraw the columns on every iteration of this loop, we will do this at the end instead
6696 * shallow copy arrays. The reason we need to do this, is that we don't want to
6697 * deep copy array init values (such as aaSorting) since the dev wouldn't be
6703 * independent copy with the exception of the `data` or `aaData` parameters
6705 * DataTables and have that used as your data source without breaking the
6709 * @todo This doesn't take account of arrays inside the deep copied objects.
6725 else if ( breakRefs && prop !== 'data' && prop !== 'aaData' && Array.isArray(val) ) {
6878 * Detect the data source being used for the table. Used to simplify the code
6911 * name: 'data' -- string - Property name
6922 * name: 'data'
7017 * Additionally the API is designed to allow you to easily work with the data in
7021 * `rows().nodes()` will return an array of nodes, while `rows().data()` will
7025 * `unique` etc) to assist your working with the data held in a table.
7048 * @param {array} [data] Data to initialise the Api instance with.
7062 _Api = function ( context, data )
7065 return new _Api( context, data );
7088 // Initial data
7089 if ( data ) {
7090 $.merge( this, data );
7105 // Don't destroy the existing prototype, just extend it. Required for jQuery 2's
7413 // name: 'data' -- string - Property name
7424 // name: 'data'
7690 * * `recordsTotal` - Full data set length
7731 // Note that we can't call this function 'length()' because `length`
7774 var data = _fnAjaxDataSrc( settings, json );
7775 for ( var i=0, ien=data.length ; i<ien ; i++ ) {
7776 _fnAddData( settings, data[i] );
7805 * Get the data submitted in the last Ajax request
7819 * Reload tables from the Ajax data source. Note that this function will
7820 * automatically re-draw the table when the remote data has been loaded.
7879 * Load data from the newly set Ajax URL. Note that this method is only
7883 * automatically redraw the table once the remote data has been loaded.
7905 // Can't just check for isArray here, as an API or jQuery instance might be
7994 // rows not shown don't exist and the index order is the applied order
8072 // must be - dev error if the index doesn't exist).
8115 var host = $(sel).closest('*[data-dt-row]');
8117 [ host.data('dt-row') ] :
8123 // of if the tr element has been created or not, so can't rely upon
8191 _api_register( 'rows().data()', function () {
8235 var data = settings.aoData;
8236 var rowData = data[ row ];
8240 data.splice( row, 1 );
8243 for ( i=0, ien=data.length ; i<ien ; i++ ) {
8244 loopRow = data[i];
8329 _api_register( 'row().data()', function ( data ) {
8332 if ( data === undefined ) {
8341 row._aData = data;
8343 // If the DOM has an id, and the data source is an array
8344 if ( Array.isArray( data ) && row.nTr && row.nTr.id ) {
8345 _fnSetObjectDataFn( ctx[0].rowId )( data, row.nTr.id );
8349 _fnInvalidate( ctx[0], this[0], 'data' );
8393 var data = settings.aoData;
8396 for (var i=0 ; i<data.length ; i++) {
8397 if (data[i]._detailsShow) {
8398 ids.push( '#' + idFn(data[i]._aData) );
8422 var __details_add = function ( ctx, row, data, klass )
8452 addRow( data, klass );
8529 var data = settings.aoData;
8533 if ( _pluck( data, '_details' ).length > 0 ) {
8541 // Internal data grab
8542 var row = data[ idx ];
8560 for ( var i=0, ien=data.length ; i<ien ; i++ ) {
8561 row = data[i];
8575 for ( var i=0, ien=data.length ; i<ien ; i++ ) {
8576 if ( data[i]._details ) {
8589 // data can be:
8593 _api_register( _child_mth, function ( data, klass ) {
8596 if ( data === undefined ) {
8602 else if ( data === true ) {
8606 else if ( data === false ) {
8612 __details_add( ctx[0], ctx[0].aoData[ this[0] ], data, klass );
8676 // iterator callback in columns().data()
8771 // Otherwise a node which might have a `dt-column` data attribute, or be
8773 var host = $(s).closest('*[data-dt-column]');
8775 [ host.data('dt-column') ] :
8787 data = settings.aoData,
8806 for ( i=0, ien=data.length ; i<ien ; i++ ) {
8807 tr = data[i].nTr;
8808 cells = data[i].anCells;
8861 _api_registerPlural( 'columns().data()', 'column().data()', function () {
8956 var data = settings.aoData;
8958 var cells = _removeEmpty( _pluck_order( data, rows, 'anCells' ) );
8982 host = data[ row ];
9023 // data attributes
9024 host = $(s).closest('*[data-dt-row]');
9027 row: host.data('dt-row'),
9028 column: host.data('dt-column')
9094 // It is a _major_ performance drag to run this if it isn't needed, so this is
9112 var data = settings.aoData[ row ];
9114 return data && data.anCells ?
9115 data.anCells[ column ] :
9121 _api_register( 'cells().data()', function () {
9168 _api_register( 'cell().data()', function ( data ) {
9172 if ( data === undefined ) {
9180 _fnSetCellData( ctx[0], cell[0].row, cell[0].column, data );
9181 _fnInvalidate( ctx[0], cell[0].row, 'data', cell[0].column );
9488 var t = $(table).get(0);
9499 if ( o.nTable === t || head === t || foot === t ) {
9556 * won't be.
9582 // Add the `dt` namespace automatically if it isn't already present
9614 _api_register( 'data()', function () {
9779 * Private data store, containing all of the settings objects that are
9873 * Data object from the original data source for the row. This is either
9876 * data from the data source, or will be an array if using DOM a data
9884 * Sorting data cache - this array is ostensibly the same length as the
9886 * needed), and holds the data that is used for sorting each column in the
9888 * the formatting of the sort data need be done only once for each cell
9898 * Per cell filtering data cache. As per the sort data cache, used to
9907 * Filtering data cache. This is the same as the cell filtering cache, but
9909 * a join on `_aFilterData`, but is provided as a cache so the join isn't
9928 * Denote if the original data source was from the DOM, or the data source
9929 * object. This is used for invalidating data, so DataTables can
9930 * automatically read data from the original source, unless uninstructed
9955 * but this one is the internal data store for DataTables's cache of columns.
9975 * at itself, but that doesn't need to be the case).
10019 * Flag to indicate if HTML5 data attributes should be used as the data
10035 * @param {array|object} oData The data for the whole row
10036 * @param {int} iRow The row index for the aoData data store
10042 * Function to get data from a cell in a column. You should <b>never</b>
10043 * access data directly through _aData internally in DataTables - always use
10048 * @param {array|object} oData The data array/object for the array
10050 * @param {string} sSpecific The specific data type you want to get -
10052 * @returns {*} The data for the cell from the given row's data
10058 * Function to set data for a cell in the column. You should <b>never</b>
10059 * set the data directly to _aData internally in DataTables - always use
10063 * @param {array|object} oData The data array/object for the array
10071 * Property to read the value for the cells in the column from the data
10081 * the data - i.e. it is basically the same as mData, but without the
10082 * 'set' option, and also the data fed to it is the result from mData.
10083 * This is the rendering method to match the data method of mData.
10127 * Allows a default value to be given for a column's data, and will be used
10128 * whenever a null data source is encountered (this can be because mData
10129 * is set to null, or because the data source itself is null).
10143 * Custom sorting data type - defines which of the available plug-ins in
10217 * An array of data to use for the table, passed in at initialisation which
10218 * will be used in preference to any data which is already in the DOM. This is
10225 * @name DataTable.defaults.data
10228 * // Using a 2D array data source
10231 * "data": [
10246 * // Using an array of objects as a data source (`data`)
10249 * "data": [
10266 * { "title": "Engine", "data": "engine" },
10267 * { "title": "Browser", "data": "browser" },
10268 * { "title": "Platform", "data": "platform" },
10269 * { "title": "Version", "data": "version" },
10270 * { "title": "Grade", "data": "grade" }
10332 * DataTables can be instructed to load data to display in the table from a
10338 * * `string` - Set the URL from where the data should be loaded from.
10340 * * `function` - Custom data get function
10346 * DataTables will load data.
10359 * * `data` - As with jQuery, `data` can be provided as an object, but it
10360 * can also be used as a function to manipulate the data DataTables sends
10368 * * `dataSrc` - By default DataTables will look for the property `data` (or
10369 * `aaData` for compatibility with DataTables 1.9-) when obtaining data
10372 * object notation to get a data source for multiple levels of nesting, or
10376 * data source for the table. This supersedes `sAjaxDataProp` from
10380 * DataTables. To manipulate / transform the data returned by the server
10388 * than Ajax could be used to obtain the required data, such as Web storage
10396 * data has been obtained. That data should be passed into the callback
10410 * // Get JSON data from a file via Ajax.
10411 * // Note DataTables expects data in the form `{ data: [ ...data... ] }` by default).
10413 * "ajax": "data.json"
10417 * // Get JSON data from a file via Ajax, using `dataSrc` to change
10418 * // `data` to `tableData` (i.e. `{ tableData: [ ...data... ] }`)
10421 * "url": "data.json",
10427 * // Get JSON data from a file via Ajax, using `dataSrc` to read data
10431 * "url": "data.json",
10437 * // Manipulate the data returned from the server - add a link to data
10439 * // is just a simple example of how the data can be manipulated).
10442 * "url": "data.json",
10453 * // Add data to the request
10456 * "url": "data.json",
10457 * "data": function ( d ) {
10469 * "url": "data.json",
10475 * // Get the data from localStorage (could interface with a form for
10478 * "ajax": function (data, callback, settings) {
10520 * column that you have in your table (these can be null if you don't which
10620 * are using an Ajax or JS data source for the table. This option, when set to
10670 * Enable or disable filtering of data. Filtering in DataTables is "smart" in
10695 * about the data that is currently visible on the page, including information
10696 * about filtered data if that action is being performed.
10753 * large amounts of data where it can take a noticeable amount of time to sort
10812 * However, this can look odd when filtering data down to a small data set,
10836 * source to obtain the required data for each draw.
10918 * classes are removed and added) so for large data sets you might want to
10967 * @param {array} data Raw data array for this row
10976 * "createdRow": function( row, data, dataIndex ) {
10978 * if ( data[4] == "A" )
11015 * @param {array} data Full table data (as derived from the original HTML)
11021 * to the full data array
11029 * "footerCallback": function( tfoot, data, start, end, display ) {
11079 * @param {array} data Full table data (as derived from the original HTML)
11085 * to the full data array
11093 * "fheaderCallback": function( head, data, start, end, display ) {
11110 * @param {int} start Starting position in data for the draw
11111 * @param {int} end End position in data for the draw
11114 * @param {int} total Total number of rows in the data set, after filtering
11140 * present if client-side Ajax sourced data is used
11189 * @param {array} data Raw data array for this row
11191 * @param {int} displayIndexFull The index of the data in the full list of
11200 * "rowCallback": function( row, data, displayIndex, displayIndexFull ) {
11202 * if ( data[4] == "A" ) {
11217 * the data from the server so something more suitable for your application.
11218 * For example you could use POST data, or pull information from a Gears or
11222 * @param {string} source HTTP source to obtain the data from (`ajax`)
11223 * @param {array} data A key/value pair object containing the data to send
11225 * @param {function} callback to be called on completion of the data get
11226 * process that will draw the data on the page.
11242 * It is often useful to send extra data to the server when making an Ajax
11245 * passed in parameter is the data set that has been constructed by
11248 * @param {array} data Data array (array of objects which are name/value
11250 * server. In the case of Ajax sourced data with server-side processing
11253 * @returns {undefined} Ensure that you modify the data array passed in,
11310 * This callback is called when the table is loading state from the stored data, but
11316 * @param {object} data The state object that is to be loaded
11326 * "stateLoadParams": function (settings, data) {
11327 * data.oSearch.sSearch = "";
11337 * "stateLoadParams": function (settings, data) {
11351 * @param {object} data The state object that was loaded
11361 * "stateLoaded": function (settings, data) {
11362 * alert( 'Saved filter was: '+data.oSearch.sSearch );
11377 * @param {object} data The state object to be saved
11386 * "stateSaveCallback": function (settings, data) {
11390 * "data": data,
11399 "fnStateSaveCallback": function ( settings, data ) {
11403 JSON.stringify( data )
11417 * @param {object} data The state object to be saved
11427 * "stateSaveParams": function (settings, data) {
11428 * data.oSearch.sSearch = "";
11458 * page draw - rather it will use the data already on the page (no sorting etc
11521 * Define the starting point for data display when using DataTables with
11739 * empty of data (regardless of filtering). Note that this is an optional
11743 * @default No data available in table
11752 * "emptyTable": "No data available in table"
11757 "sEmptyTable": "No data available in table",
11772 * * `\_PAGES\_` - Total number of pages of data in the table
11860 * language options since DataTables doesn't output floating point
11861 * numbers, so it won't ever use this for display of a number. Rather,
11954 * When using Ajax sourced data and during the first draw when DataTables is
11955 * gathering the data, this message is shown in an empty row in the table to
11956 * indicate to the end user the the data is being loaded. Note that this
11957 * parameter is not used when loading data by server-side processing, just
11958 * Ajax sourced data with client-side processing.
12098 * any point in the data), when false this will not be done.
12119 * By default DataTables will look for the property `data` (or `aaData` for
12120 * compatibility with DataTables 1.9-) when obtaining data from an Ajax
12123 * get a data source for multiple levels of nesting.
12125 * @default data
12133 "sAjaxDataProp": "data",
12140 * You can instruct DataTables to load data from an external
12141 * source using this parameter (use aData if you want to pass data in you
12166 * <li>'t' - The table!</li>
12188 * <li>'&lt;lf&lt;t&gt;ip&gt;'</li>
12194 * <"H"lfr>t<"F"ip> <i>(when `jQueryUI` is true)</i>
12308 * to the given height, and enable scrolling for any data which overflows the
12310 * a lot of data in a small area (although paging and scrolling can both be
12335 * processing or Ajax sourced data.
12367 * Set the data property name that DataTables should use to get a row's id
12394 * doing a sort or use the data from a different column. For example first
12473 * Enable or disable filtering on the data in this column.
12579 * @param {array|object} rowData The data for the whole row
12580 * @param {int} row The row index for the aoData data store
12604 * This parameter has been replaced by `data` in DataTables to ensure naming
12607 * recommended that you use `data` in preference to `dataProp`.
12613 * This property can be used to read data from any data source property,
12614 * including deeply nested objects / properties. `data` can be given in a
12617 * * `integer` - treated as an array index for the data source. This is the
12619 * * `string` - read an object property from the data source. There are
12621 * DataTables reads the data from the source object:
12624 * specified in `data`. For example: `browser.version` or
12627 * * `[]` - Array notation. DataTables can automatically combine data
12628 * from and array source, joining the data with the characters provided
12635 * simple function on the data source, `browser.version()` for a
12639 * `data` as it is much simpler to use as a renderer.
12640 * * `null` - use the original data source for the row rather than plucking
12641 * data directly from it. This action has effects on two other
12643 * * `defaultContent` - When null is given as the `data` option and
12646 * * `render` - When null is used for the `data` option and the `render`
12647 * option is specified for the column, the whole data source for the
12650 * needs to set or get the data for a cell in the column. The function
12653 * * `{array|object}` The data source for the row
12654 * * `{string}` The type call data requested - this will be 'set' when
12655 * setting data or 'filter', 'display', 'type', 'sort' or undefined
12656 * when gathering data. Note that when `undefined` is given for the
12657 * type DataTables expects to get the raw data for the object back<
12662 * for the data requested.
12664 * Note that `data` is a getter and setter option. If you just require
12665 * formatting of data for output, you will likely want to use `render` which
12668 * Note that prior to DataTables 1.9.2 `data` was called `mDataProp`. The
12677 * @name DataTable.defaults.column.data
12681 * // Read table data from objects
12694 * { "data": "engine" },
12695 * { "data": "browser" },
12696 * { "data": "platform" },
12697 * { "data": "version" },
12698 * { "data": "grade" }
12720 * { "data": "engine" },
12721 * { "data": "browser" },
12722 * { "data": "platform.inner" },
12723 * { "data": "details.0" },
12724 * { "data": "details.1" }
12730 * // Using `data` as a function to provide different information for
12736 * "data": function ( source, type, val ) {
12763 * "data": null,
12775 * "data": "name[, ]"
12785 * This property is the rendering partner to `data` and it is suggested that
12786 * when you want to manipulate data for display (including filtering,
12787 * sorting etc) without altering the underlying data for the table, use this
12789 * `data` which is read / write (then as such more complex). Like `data`
12793 * * `integer` - treated as an array index for the data source. This is the
12795 * * `string` - read an object property from the data source. There are
12797 * DataTables reads the data from the source object:
12800 * specified in `data`. For example: `browser.version` or
12803 * * `[]` - Array notation. DataTables can automatically combine data
12804 * from and array source, joining the data with the characters provided
12811 * simple function on the data source, `browser.version()` for a
12814 * * `object` - use different data for the different data types requested by
12816 * of the object is the data type the property refers to and the value can
12819 * This is the default value to use if you haven't specified a value for
12820 * the data type requested by DataTables.
12822 * needs to set or get the data for a cell in the column. The function
12825 * * {array|object} The data source for the row (based on `data`)
12826 * * {string} The type call data requested - this will be 'filter',
12828 * * {array|object} The full data source for the row (not based on
12829 * `data`)
12832 * data requested.
12835 * @default null Use the data source value.
12846 * { "data": "engine" },
12847 * { "data": "browser" },
12849 * "data": "platform",
12857 * // Execute a function to obtain data
12862 * "data": null, // Use the full data source object for the renderer's source
12869 * // As an object, extracting different data for the different types
12870 * // This would be used with a data source such as:
12879 * "data": null, // Use the full data source object for the renderer's source
12890 * // Use as a function to create a link from the data source
12895 * "data": "download_link",
12896 * "render": function ( data, type, full ) {
12897 * return '<a href="'+data+'">Download</a>';
12973 * Generally you shouldn't need this!
12999 * Allows a default value to be given for a column's data, and will be used
13000 * whenever a null data source is encountered (this can be because `data`
13001 * is set to null, or because the data source itself is null).
13014 * "data": null,
13031 * "data": null,
13086 * Defines a data source type for the ordering which can be used to read
13164 * The type allows you to specify how the data for this column will be
13172 * @default null <i>Auto-detected from raw data</i>
13248 * given table, including configuration, data and current application of the
13256 * one is the internal data store for DataTables's cache of columns. It should
13261 * don't need to create new instances on each $().dataTable() call (if the
13287 * increase for Ajax source and Javascript source data, but makes no
13343 * get all data from the server for every draw - there is no filtering,
13500 * <li>'t' - The table!</li>
13511 * Store data information - see {@link DataTable.models.oRow} for detailed
13533 * Map of row ids to data indexes
13744 * Indicate if when using server-side processing the loading of data
13846 * Source url for AJAX data for the table.
13855 * Property from a given object from which to read the table data from. This
13865 * The last jQuery XHR object that was used for server-side data gathering.
13888 * Function to get the server-side data.
13945 * Draw index (iDraw) of the last error when parsing the returned data
14135 * Function used to get a row's id from the row's data
14262 * and your logic decides if it should be included in the searching data set
14270 * original format that was passed in as the data source, or an array
14271 * from a DOM data source
14289 * // fourth column (i.e. the data[3] index) based on two input values
14290 * // from the end-user, matching the data in a certain range.
14292 * function( settings, data, dataIndex ) {
14295 * var version = data[3] == "-" ? 0 : data[3]*1;
14320 * selector modifier options (`selector-modifier` object data type) that
14433 * Ordering plug-ins - custom data source
14435 * The extension options for ordering of data available here is complimentary
14437 * allows much greater control over the the data that is being used to
14440 * This type of ordering is useful if you want to do ordering based on data
14446 * array. The data in the array much be in the index order of the rows in
14447 * the table (not the currently ordering order!). Which order data gathering
14491 * when complex data is in the table.
14512 * function ( data, settings ) {
14514 * if ( ! data.substring(1).match(/[0-9]/) ) {
14519 * if ( data.charAt(0) == '$' || data.charAt(0) == '&pound;' ) {
14533 * data to be search on. For example, it can be used to strip HTML
14539 * Pre-processing of searching data plug-ins - When you assign the sType
14543 * by allowing you to pre-processing the data and returning the data in
14547 * for searching data.
14844 _fnPageChange( settings, e.data.action, true );
14920 'data-dt-idx': button,
14947 activeEl = $(host).find(document.activeElement).data('dt-idx');
14954 $(host).find( '[data-dt-idx='+activeEl+']' ).trigger('focus');
15026 html: function ( data ) {
15027 return _empty(data) ?
15028 data :
15029 typeof data === 'string' ?
15030 data
15036 string: function ( data ) {
15037 return _empty(data) ?
15038 data :
15039 typeof data === 'string' ?
15040 data.replace( _re_new_lines, " " ) :
15041 data;
15160 // Numeric sorting types - order doesn't matter here
15237 * Public helper functions. These aren't used internally by DataTables, or
15470 * * `number` - Will format numeric data (defined by `columns.data`) for
15471 * display, retaining the original unformatted data for sorting and filtering.
15484 * data: "salary",
15517 // If NaN then there isn't much formatting that we can do - just
15532 // If zero, then can't have a negative prefix