Loading super slow
Loading super slow
satyriasis
Posts: 30Questions: 7Answers: 0
Link to test case:
Debugger code (debug.datatables.net): https://masinko.hr/baza-podataka-adrese/
Error messages shown:
Description of problem: Hi guys, what can I do when my table reaches a lot of entries?(around 5k) It takes FOREVER to load my website. Is there any solution to this?
Answers
You loading the table into the DOM then initializing Datatables. See this FAQ about options to improve performance.
Kevin
Can you please explain which one of these is best option for me? Also, how to add it to the code here?```
jQuery(document).ready( function () { jQuery('#ana1').DataTable({ responsive: true, language: { url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/hr.json' }, dom: 'Bfrtip', buttons: [ { extend: 'copy', className: 'nectar-button medium regular extra-color-1 regular-button tableBtn' }, { extend: 'csv', className: 'nectar-button medium regular extra-color-1 regular-button tableBtn' }, { extend: 'excel', className: 'nectar-button medium regular extra-color-1 regular-button tableBtn' }, { extend: 'print', className: 'nectar-button medium regular extra-color-1 regular-button tableBtn' } ] }); });<style>
.dataTables_filter input {
margin-bottom: 30px;
}
</style>```
I’d suggest Ajax loading with
deferRender
enabled.Allan
Can someone suggest me how to include code for ajax into my code?
What I need to add (based on above sugesstion
What I have now:
Everything I try is wrong, I dont have any experience in this, please help me
You just need to add the
ajax
into the list of options, so something like:Colin
**This gives me error in browser: DataTables warning: table id=ana1 - Ajax error. For more information about this error, please see http://datatables.net/tn/7**
What I done:
Do I need to delete dom: 'Bfrtip', or maybe some of bracquets });?
Follow the troubleshooting steps provided in the error link:
http://datatables.net/tn/7
Likely the server is responding with an error. You will need to check the server logs to find the problem.
Kevin
I am quite sure I didnt paste Colins code properly. When I put it to old state everything works fine, but loads slowly. Do I need to remove
dom: 'Bfrtip',
or maybe some of bracquets});
?No.
You have this. Do you have a web server to respond to the ajax request?
If you are not familiar with ajax see this tutorial.
Kevin
I am sorry, kthorngren , even after reading this link, I dont understand your question. I am really a beginner asking for a help, and If I fix this, it would be my final step and all of my struggles would be finished...
What ever I try I get this error message (check on link https://masinko.hr/baza-podataka-adrese/?nocache=1). I really dont know what is a web server to respond, can you suggest me what to write in code?
Maybe this What is a web server tutorial might help. Choosing what to use is beyond the scope of this forum. Stack Overflow is a better place to ask questions about choosing and setting up a web server.
Once setup the web server will will respond to the ajax request with the table data.
Kevin