* Get the data for a given cell from the internal cache, taking into account data mapping * @param {object} oSettings dataTables settings object * @param {int} iRow aoData row id * @param {int} iCol Column index * @param {string} sSpecific data get type ('display', 'type' 'filter' 'sort'
( oSettings, iRow, iCol, sSpecific )
| 1042 | * @memberof DataTable#oApi |
| 1043 | */ |
| 1044 | function _fnGetCellData( oSettings, iRow, iCol, sSpecific ) |
| 1045 | { |
| 1046 | var oCol = oSettings.aoColumns[iCol]; |
| 1047 | var oData = oSettings.aoData[iRow]._aData; |
| 1048 | var sData = oCol.fnGetData( oData, sSpecific ); |
| 1049 | |
| 1050 | if ( sData === undefined ) |
| 1051 | { |
| 1052 | if ( oSettings.iDrawError != oSettings.iDraw && oCol.sDefaultContent === null ) |
| 1053 | { |
| 1054 | _fnLog( oSettings, 0, "Requested unknown parameter "+ |
| 1055 | (typeof oCol.mData=='function' ? '{function}' : "'"+oCol.mData+"'")+ |
| 1056 | " for row "+iRow, 4 ); |
| 1057 | oSettings.iDrawError = oSettings.iDraw; |
| 1058 | } |
| 1059 | return oCol.sDefaultContent; |
| 1060 | } |
| 1061 | |
| 1062 | /* When the data source is null, we can use default column data */ |
| 1063 | if ( (sData === oData || sData === null) && oCol.sDefaultContent !== null ) |
| 1064 | { |
| 1065 | sData = oCol.sDefaultContent; |
| 1066 | } |
| 1067 | else if ( typeof sData === 'function' ) |
| 1068 | { |
| 1069 | // If the data source is a function, then we run it and use the return |
| 1070 | return sData(); |
| 1071 | } |
| 1072 | |
| 1073 | if ( sData === null && sSpecific == 'display' ) |
| 1074 | { |
| 1075 | return ''; |
| 1076 | } |
| 1077 | return sData; |
| 1078 | } |
| 1079 | |
| 1080 | |
| 1081 | /** |
no test coverage detected