mirror of
https://github.com/DataTables/DataTables.git
synced 2025-03-15 16:29:16 +01:00
Add documentation note on the fact that mDataProp as a function can get a 'type' of undefined when raw data is expected to be returned
This commit is contained in:
parent
d22e47ede1
commit
918a065f21
34
media/js/jquery.dataTables.js
vendored
34
media/js/jquery.dataTables.js
vendored
@ -5713,7 +5713,7 @@
|
||||
var i, iLen;
|
||||
var aoColumns = oSettings.aoColumns;
|
||||
var aoData = oSettings.aoData;
|
||||
var nTd, nCell, anTrs, jqChildren, bAppend, iBefore;
|
||||
var nTd, bAppend, iBefore;
|
||||
|
||||
/* No point in doing anything if we are requesting what is already true */
|
||||
if ( aoColumns[iCol].bVisible == bShow )
|
||||
@ -5899,7 +5899,7 @@
|
||||
this.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction )
|
||||
{
|
||||
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
|
||||
var iVisibleColumn, i, iLen, sDisplay;
|
||||
var i, iLen, sDisplay;
|
||||
var iRow = (typeof mRow === 'object') ?
|
||||
_fnNodeToDataIndex(oSettings, mRow) : mRow;
|
||||
|
||||
@ -8636,12 +8636,18 @@
|
||||
* will be applied to it), thus saving on an XHR at load time. iDeferLoading
|
||||
* 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
|
||||
* the information element and pagination to be displayed correctly).
|
||||
* @type int
|
||||
* the information element and pagination to be displayed correctly). In the case
|
||||
* where a filtering is applied to the table on initial load, this can be
|
||||
* indicated by giving the parameter as an array, where the first element is
|
||||
* the number of records available after filtering and the second element is the
|
||||
* number of records without filtering (allowing the table information element
|
||||
* to be shown correctly).
|
||||
* @type int | array
|
||||
* @default null
|
||||
* @dtopt Options
|
||||
*
|
||||
* @example
|
||||
* // 57 records available in the table, no filtering applied
|
||||
* $(document).ready(function() {
|
||||
* $('#example').dataTable( {
|
||||
* "bServerSide": true,
|
||||
@ -8649,6 +8655,19 @@
|
||||
* "iDeferLoading": 57
|
||||
* } );
|
||||
* } );
|
||||
*
|
||||
* @example
|
||||
* // 57 records after filtering, 100 without filtering (an initial filter applied)
|
||||
* $(document).ready(function() {
|
||||
* $('#example').dataTable( {
|
||||
* "bServerSide": true,
|
||||
* "sAjaxSource": "scripts/server_processing.php",
|
||||
* "iDeferLoading": [ 57, 100 ],
|
||||
* "oSearch": {
|
||||
* "sSearch": "my_filter"
|
||||
* }
|
||||
* } );
|
||||
* } );
|
||||
*/
|
||||
"iDeferLoading": null,
|
||||
|
||||
@ -9762,8 +9781,9 @@
|
||||
* <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' or 'sort' when gathering
|
||||
* data.</li>
|
||||
* 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
|
||||
@ -9811,7 +9831,7 @@
|
||||
* else if (type === 'filter') {
|
||||
* return source.price_filter;
|
||||
* }
|
||||
* // 'sort' and 'type' both just use the integer
|
||||
* // 'sort', 'type' and undefined all just use the integer
|
||||
* return source.price;
|
||||
* }
|
||||
* ]
|
||||
|
@ -355,8 +355,9 @@ DataTable.defaults.columns = {
|
||||
* <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' or 'sort' when gathering
|
||||
* data.</li>
|
||||
* 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
|
||||
@ -404,7 +405,7 @@ DataTable.defaults.columns = {
|
||||
* else if (type === 'filter') {
|
||||
* return source.price_filter;
|
||||
* }
|
||||
* // 'sort' and 'type' both just use the integer
|
||||
* // 'sort', 'type' and undefined all just use the integer
|
||||
* return source.price;
|
||||
* }
|
||||
* ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user