Looking for code example to speed up load of large tables
Looking for code example to speed up load of large tables
We have a dynamic wp site with rich data incl pictures. Loading of a page with such a table looks strange, the visitor sees at the beginning long seconds while the table builds up row by row - including flicking various sized pictures on the screen -, than that table gets rendered with thumbnails in the rows and in the third phase the table flicks again and gets sorted.
Please help me to find the proper parts of the documentation (and maybe some coding examples) for:
a) how can I generate midnights a static wp page with the current daily content of the given table
b) how can I use that static table data in a new search page?
Many thanks in advance!
This question has an accepted answers - jump to answer
Answers
I'm not familiar with WP but this FAQ provides information of how to speed up Datatables.
Sounds like this process is before Datatables.
Is this before or after Datatables is initialized
This is definitely Datatables.
If Datatables is only involved in the third phase then you can hide all this by placing the
table
in a hiddendiv
then show thediv
when the Datatable initialization is complete. For example:http://live.datatables.net/pinaqopu/1/edit
It uses
columns.adjust()
after the Datatable is shown to finalize the columns widths.Kevin
Thank you, Kevin! your example snippet works well in a small model. On my WP page I have built a static html table within the hidden div, and appended a call to your .js which I had to store as a file within the js folder in the WP Theme directory. Great!
Maybe someone in this forum has an answer to my first question as well?