Datatable using DOM and javascript objects limitations
Datatable using DOM and javascript objects limitations

I am working on a website that contains many tables and DataTables with DOM data source is used for all of them. Everything was fine until I used DataTables for tables with 2000 records or above. The DataTables is taking around 3 or 4 seconds for rendering, I don't mean the query execution time, everything is fine from the server-side, the table is displayed successfully and after 4 seconds the search bar and the other DataTables features appear. After searching I switch over to using Javascript source loading of data with deferred rendering option which fastens the rendering.
So my first question is:
- is switching over to use the Javascript source with deferred rendering instead of DOM is the proper solution for the slow rendering or there is a solution that could be done with the DOM Datasource?
If the solution is to use Javascript source with deferred rendering than I am facing some issues using this approach, which needed to be clarified
- is there is a way to use javascript objects as data source without specifying the columns using the columns option
- in my table there is an additional column for the details link is there is a way to display this column with the Javascript source. I found a way in this link https://datatables.net/examples/ajax/null_data_source.html but it seems it is working only with Ajax data source, it did not work in my case
Answers
The
deferRender
works with JS or Ajax data. There aren't any options for Datatables to improve speed with DOM based data.If your data is object based you need to use
columns.data
to define the column for each object property. What problem are you trying to solve by not doing this?That example should work with JS sourced data. What happens?
Kevin