开发者

How to prevent a big html table to be loaded everytime the site is visited? (Using datatables, a jQuery plugin)

I'm developing the CRUD for a back-end tool and I'm using DataTables (a jQuery plugin that helps handling HTML tables) to display the list of elements of each row along with the view, edit and remove options. The tables are about 4,000 rows and the loading time is about 7 seconds. I tried 开发者_如何学Cserver-side processing and got almost no improvement, I also setted

table-layout: fixed; 

and that didn't help either.

The problem is that after clicking view/edit and going back to the table it reloads taking 7 seconds again.

In the solution I'm thinking about, only the first load takes those 7 seconds, and afterwards it should load intantaneously. (I'll provide an option to refresh in case the user wants to see any changes). The problem is I don't know how to do this.

If you think my idea is good can you help me with the solution? if not, then what should I do?

PS: Does 7 second loading time for a 4,000 row table sounds right? or am I doing something else wrong?

PS2: I'm developing using PHP and no framework.

Thank you very much for your help!

UPDATE:

I partially solved the problem, for displaying big tables I used Deferred Rendering which works lighting fast! BUT I don't know how to store links in the DataTables' aaData array (I don´t know if it's even posible, if it is please let me know). On the other hand what was really causing the table rendering to slow down was that I had 3 buttons for each row (View/Edit/Delete) So I removed them and I'm using only a view link, now the table loads in about 2 seconds.


Limit the rows to 10-25-50-100-500-1000-2000-4000 per page. So if the user wants to view all results, let the user choose that how much does he/she want display. (something similar to stackoverflow's system)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜