Client side data with million of rows with DOM and pagination optimization
Client side data with million of rows with DOM and pagination optimization
Hi,
Datatables is a great tool. I am using the datatables for pagination, sorting, filtering. The issue that i am facing now is when my server returns 1 million of records to client side, client creates dom (with tables) and then we apply pagination ontop of it, this slow downs the data load process on the client side (I understand we should be using Ajax to upload the data and use server side processing) Is there a way i can display just say 50 records to clients and let the processing be done behind the scene till user to watching those 50 records?
Or is there a way i can just display say 50 records and on next click, i can do pagination then for next 50 records for the user and display it. But another things is filter and sort should not be impacted due to this. Is this something possible?
Thanks in advance.
Datatables is a great tool. I am using the datatables for pagination, sorting, filtering. The issue that i am facing now is when my server returns 1 million of records to client side, client creates dom (with tables) and then we apply pagination ontop of it, this slow downs the data load process on the client side (I understand we should be using Ajax to upload the data and use server side processing) Is there a way i can display just say 50 records to clients and let the processing be done behind the scene till user to watching those 50 records?
Or is there a way i can just display say 50 records and on next click, i can do pagination then for next 50 records for the user and display it. But another things is filter and sort should not be impacted due to this. Is this something possible?
Thanks in advance.
This discussion has been closed.
Replies
http://datatables.net/release-datatables/examples/server_side/defer_loading.html :-)
Allan
In my case i already prepared the DOM on client side (meaning table with 1 million of rows) and then we are executing the java script. So do you mean that if i use iDeferLoading attribute, then it would help me on client side without server side processing? I will try that out...
For DOM loading only, iDeferLoading will not work. The only way is to use some external Javascript (i.e. not DataTables itself) before you initialise the table. However, 1 million records client-side is going to crush most browsers, and utterly kill IE9-. If you can use server-side processing in future, I'd very much recommend it.
Allan