From 275c7520db7d336be807ed5b6ade4c14cb5453b6 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 10 May 2011 06:38:17 +0100 Subject: [PATCH] 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. --- media/js/jquery.dataTables.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index fc29c6d5..74803d08 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -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,