Closed tranfuga25s closed 10 years ago
PHP's json_encode
doesn't support functions. So your option is provide your own init method, and add your function to the dataTableSettings
js var that is set with the helper.
Set scriptBlock
to false for the helper settings so it doesn't add the default to the scripts block, and write your own init method, like so:
$('.dataTable').each(function() {
var table = $(this);
var model = table.attr('data-model');
var settings = dataTableSettings[model];
settings['fnFooterCallback'] = function() { ... }; // This line, adds it to the rest of the settings the helper generates
table.dataTable(settings);
});
is there a way to specify some callback and not get parsed as string to get something like this to the output:
if specified as "fnFooterCallback" => "function()..." it get's wrapped in text and never get excuted..