"Html string" data payload for ajax callback
"Html string" data payload for ajax callback
Please allow calling the ajax callback function with an HTML string.
This way I could more easily use datatables with a JS templating engine such as the one included with lodash/underscore.
Please consider this same enhancement for the "data" option which can be used to initially construct the datatable widget.
When datatables is combined with a JS templating engine it makes for a very pleasant experience because I can focus on writing the HTML and use HTML5 data attributes, with minimal boilerplate JS code on each page.
Example:
$('#example').dataTable( {
"ajax": function (data, callback, settings) {
callback('<tbody><tr><td>A</b><td>B</td></tr><tr><td>C</td><td>D</td></tr></tbody>');
);
}
} );
Answers
Note that this is meant to be a feature request, I guess I posted it in the wrong forum.