Datatable options doesnot work
Datatable options doesnot work
shumanbaral
Posts: 2Questions: 1Answers: 0
I have created a table using a javascript. I used it with datatable but the options(search,pagination) won't work. I tested on table created from html tags directly and it works. Can anybody please figure out my mistake. Thank you for your help in advance. I have tried here in jsfiddle .
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Works fine if you load the data before you call dataTable
i.e. if you move your fetching of the data to before your call to datatable.
See http://jsfiddle.net/k6mk3r4q/1/
I'm fairly certain you're also doing a lot of unnecessary manual work and you should look at loading the data using the datatable API instead of manually formatting the table
Also see:
http://jsfiddle.net/k6mk3r4q/4/ for a better implementation
Thank you very much for the suggestion. I tried this one http://jsfiddle.net/shumanbaral/LgLxxmaL/1/
It worked fine with only some line of code.