In jquery Datatables is it possible to define columns with a server-side script? I need something like this
The columns with dates have to be loaded from server. Then number of columns can vary.
In jquery Datatables is it possible to define columns with a server-side script? I need something like this
The columns with dates have to be loaded from server. Then number of columns can vary.
To expand on what Kamal Deep Singh was saying:
You could dynamically create the table on the fly, then apply datatables to it to get datatables' functionality.
and then:
Note you can put settings in that .dataTable() as normal, however, not 'sAjaxSource' or any of the associated data-getting functions -- this is applying datatables to an already existing table, one we created on the fly.
Ok, so it's kind of a hacky way of doing it, but it should work.
There isn't currently a built in method of doing this with datatables dynamically. See here: https://github.com/DataTables/DataTables/issues/273
I think I have found what you were looking for
I will paste some code + post a link to a similar Q' in which you will get much more info...
where json is something like this
here a link to the original thread
Column definition via JSON array (ajax)