Larry
Larry

Reputation: 989

DataTables: draw table first, then populate it with data from server side call

Is there a way to draw the table first, for example where the length will be set at 10 rows?

I want to draw the table first, with a height of 10 rows, which should be very fast, then populate the data from a server side call. In the jquery plug-in jqGrid, it does this. and when it is processing the ajax call, it displays a msg "loading".

Upvotes: 0

Views: 3928

Answers (1)

Allan Jardine
Allan Jardine

Reputation: 5453

I'm not 100% certainly what you are looking for (specifically I don't know what you mean by "draw the table first"), but DataTables has a deferred loading option: http://datatables.net/release-datatables/examples/server_side/defer_loading.html . With this option your HTML table is read from the DOM and what is read is used as the first page (so you just need to create your HTML table with the first 10 rows). Then any subsequent requests are server-side processing.

Upvotes: 2

Related Questions