From 5f82b240bc468ecee50029aacb2778596fe7f642 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Sat, 10 Sep 2011 09:12:23 +0100 Subject: [PATCH] New: If a data source is found to be a function, then the function is executed and the return used for the cell display (+sorting, filtering etc). This is useful for integration with knockout.js and backbone.js etc. --- media/js/jquery.dataTables.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index a295cafa..6b81db6e 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -6681,6 +6681,11 @@ { sData = oCol.sDefaultContent; } + else if ( typeof sData == 'function' ) + { + /* If the data source is a function, then we run it and use the return */ + return sData(); + } if ( sSpecific == 'display' && sData === null ) {