1

I am looking to load a large dataset from server into the jQuery DataTables (thousands of rows with about 20 to 30 columns)

Instead of loading the entire data on one go, I would like to load the table chunk by chunk. Make an ajax call fetch back a few hundred rows and repeat, when the user scrolls down. Something like feeds on facebook and twitter. You scroll down, more ajax calls are fired and more data comes to the browser DOM and gets rendered.

I am exploring various options. One was I thought was using fnAddData() API as well as iDeferLoading. Has anyone done this before or has any other pointers that I can look up?

1 Answer 1

2

Use server side processing where JQuery DatraTables send new ajax requests for each new page. Maybe you can also use infinite scrolling. Configuration shoudl look like:

$('#example').dataTable( {
    "bServerSide": true,
    "sAjaxSource": "../server_side/scripts/server_processing.php"
    sScorollX: "300px", 
    sScrollY: "200px"
    bScrollInfinite:true //this property disables pagination
} );

You can find more details on the DataTables site.

Jovan

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.