简体   繁体   中英

php jquery datatable load issue

I have the table with 15000 data in it. While open the page, it fluctuates many times. ie Its loads the entire data first. Then only it applies the pagination. I have set the 500 records per page. But the page load is very bad. Is it possible to load only 500 records first instead of load the entire data.

Please let me know your suggestions. Thanks

What you are doing is wrong. What you have to do is use AJAX for this. DataTables supports AJAX right out of the box.

http://www.datatables.net/examples/data_sources/ajax.html

http://www.datatables.net/release-datatables/examples/data_sources/ajax.html

1st loads the data you want. Then when then use requests for more data get it through a AJAX request.

Perhaps you should try lazy loading. To configure it, you should consult this link: http://datatables.net/usage/server-side

If you use lazy loading, the records get initialized when needed.

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM