简体   繁体   中英

Select (*) alternative - using jQuery datatables plugin

I am using jQuery dataTables plugin in a custom phonebook I have created for my organizations phonebook. The issue that I am having is that since I am using the SELECT * from Table command on a table with some 3000+ rows, dataTables wants to load the entire SQL table before loading and it causes the page to lag terribly. Is there a better way to do this? My reason for using dataTables is it has a custom jQuery search option which works beautifully.

I have tried using SELECT TOP but it will not return anything but the first hundred or however many specified.

You can load partial data and use ajax to load more data when the user pages through the result. Have a look at the example they provide.

https://datatables.net/release-datatables/examples/server_side/pipeline.html

Try AJAX paging, like Vlad says.

Also check out the bDeferRender option (look it up here ). If set to true you definitely experience faster page load. I dont know if that will be fast enough without server-side paging though. And what about the stress put on the DB?

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