mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-21 19:54:15 +01:00
New: fnGetData now has a second parameter (optionally) to get the column data used by DataTables based on mDataSource
This commit is contained in:
parent
f172ef5383
commit
7c4958ee60
17
media/js/jquery.dataTables.js
vendored
17
media/js/jquery.dataTables.js
vendored
@ -1776,16 +1776,15 @@
|
|||||||
* Function: fnGetData
|
* Function: fnGetData
|
||||||
* Purpose: Return an array with the data which is used to make up the table
|
* Purpose: Return an array with the data which is used to make up the table
|
||||||
* Returns: array array string: 2d data array ([row][column]) or array string: 1d data array
|
* Returns: array array string: 2d data array ([row][column]) or array string: 1d data array
|
||||||
* or
|
* or string if both row and column are given
|
||||||
* array string (if iRow specified)
|
|
||||||
* Inputs: mixed:mRow - optional - if not present, then the full 2D array for the table
|
* Inputs: mixed:mRow - optional - if not present, then the full 2D array for the table
|
||||||
* if given then:
|
* if given then:
|
||||||
* int: - return 1D array for aoData entry of this index
|
* int: - return data object for aoData entry of this index
|
||||||
* node(TR): - return 1D array for this TR element
|
* node(TR): - return data object for this TR element
|
||||||
* Inputs: int:iRow - optional - if present then the array returned will be the data for
|
* int:iCol - optional - the column that you want the data of. This will take into
|
||||||
* the row with the index 'iRow'
|
* account mDataSource and return the value DataTables uses for this column
|
||||||
*/
|
*/
|
||||||
this.fnGetData = function( mRow )
|
this.fnGetData = function( mRow, iCol )
|
||||||
{
|
{
|
||||||
var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
|
var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
|
||||||
|
|
||||||
@ -1794,6 +1793,10 @@
|
|||||||
var iRow = (typeof mRow == 'object') ?
|
var iRow = (typeof mRow == 'object') ?
|
||||||
_fnNodeToDataIndex(oSettings, mRow) : mRow;
|
_fnNodeToDataIndex(oSettings, mRow) : mRow;
|
||||||
|
|
||||||
|
if ( typeof iCol != 'undefined' )
|
||||||
|
{
|
||||||
|
return _fnGetCellData( oSettings, iRow, iCol, '' );
|
||||||
|
}
|
||||||
return (typeof oSettings.aoData[iRow] != 'undefined') ?
|
return (typeof oSettings.aoData[iRow] != 'undefined') ?
|
||||||
_fnGetRowData( oSettings, iRow, '' ) : null;
|
_fnGetRowData( oSettings, iRow, '' ) : null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user