About to reduce Datatable loading time

Hi,
I m using Bootstrap Template’s Datatable functionality for showing records in Grid View but when i come on page because of 2000 records it is taking load. Since Datatable load all data from database at one time and then create pagination. So, can we load only first 10 records when page opens and then on click of pagination index relevant 10 records. Plz tell me where can i make changes to do this???
Attached is Grid View pics which contains almost 2000 records so it takes loading even on single action on this page. Plz help.

Snap2

* image edited in

No pictures are attached. However, it’ll be easier for people to give you help if you show your code, rather than screen shots.

Well first let me say, if you’re showing 10 records at a time, noone in their right mind is going to scroll through 2000 records. Consider condensing your display, and putting more records on a page.

Better than code for this is going to be actually giving a link to the page if possible; its entirely plausible that the datatable isnt your choke point.

Loading 2000 records at once seems excessive. You should be loading like a 100 rows initially and deferring the rest until the user actually requests that info. Every data table which I have worked with provides a way to load info based on a user interaction or pagination using JavaScript.

That documentation is terrible but I think this is the right direction.

https://datatables.net/examples/data_sources/ajax.html

More

https://datatables.net/examples/server_side/defer_loading.html

Terrible docs…

Hi,
Below attached pics contains 2098 records…when we come on page it takes load because it loads all records first and then create pagination. So, is there any solution?? In which it will load first 10 records with all pagination buttons and then click on relevant button it will show relevant 10 records.

e.g. If i will click on 5 number of pagination then it will fetch 41 to 50 records i.e. relevant 10

Thanks,
Sagar Gavali.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.