1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-18 11:52:11 +01:00

Fix: When using fnRender with a null mDataProp, although the rendering function was called, it wasn't actually saved anywhere. This meant that when the cell was actually created and the data source attempted to be read, the rendered string wasn't available - thus you got an empty cell (4943). This fix is to add a condition to the rendering call to delay until the node is created. Note that there is still a quirk here, in that the rendered data cannot be used for sorting or filtering, since again it isn't stored anywhere when the data source is null.

This commit is contained in:
Allan Jardine 2011-05-10 06:38:17 +01:00
parent 3464502c06
commit 275c7520db

View File

@ -2677,7 +2677,7 @@
oCol = oSettings.aoColumns[i];
/* Use rendered data for filtering/sorting */
if ( typeof oCol.fnRender == 'function' && oCol.bUseRendered )
if ( typeof oCol.fnRender == 'function' && oCol.bUseRendered && oCol.mDataProp !== null )
{
_fnSetCellData( oSettings, iRow, i, oCol.fnRender( {
"iDataRow": iRow,
@ -2752,7 +2752,7 @@
/* Render if needed - if bUseRendered is true then we already have the rendered
* value in the data source - so can just use that
*/
if ( typeof oCol.fnRender == 'function' && !oCol.bUseRendered )
if ( typeof oCol.fnRender == 'function' && (!oCol.bUseRendered || oCol.mDataProp === null) )
{
nTd.innerHTML = oCol.fnRender( {
"iDataRow": iRow,