Build a DataTable at runtime

Build a DataTable at runtime

Karl53Karl53 Posts: 72Questions: 29Answers: 0

Is it possible to build a DataTable at runtime?

This is my markup:

<table class="display compact" id="MY-TABLE" style="width:100%">
</table>

This is the JavaScript constructor call:

tblMine = $('#MY-TABLE').DataTable();

When the call to the constructor executes, I get this error:

jquery.dataTables.js:5856 Uncaught TypeError: Cannot read property 'aDataSort' of undefined

I do not know either the row count or number of columns until runtime.

TIA.

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.