"Html string" data payload for ajax callback

"Html string" data payload for ajax callback

craigrs84craigrs84 Posts: 2Questions: 1Answers: 0

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

  • craigrs84craigrs84 Posts: 2Questions: 1Answers: 0

    Note that this is meant to be a feature request, I guess I posted it in the wrong forum.

This discussion has been closed.