New example: Server-side processing with pipelining
New example: Server-side processing with pipelining
Hello all,
I've just put together a new example for DataTables 1.5's server-side processing option which will cache information about hidden pages in order to reduce the number of Ajax calls made to the server when using simple paging: http://datatables.net/1.5-beta/examples/server_side/pipeline.html
Basically the modified fnServerData() function will edit the request made to the server, asking for more information than is required. Then when the user requests that the next page be shown, this function will intercept the call the server (it's not needed) and give DataTables the required information from it's cache.
Of course interaction such as filtering or sorting will cause the pipeline to be flushed, but sending a little extra data that might be flushed is cheap compared to making XHR requests for each page to display (typically the most common interaction with a DataTable).
Hope some of you using server-side processing find this useful :-)
Allan
I've just put together a new example for DataTables 1.5's server-side processing option which will cache information about hidden pages in order to reduce the number of Ajax calls made to the server when using simple paging: http://datatables.net/1.5-beta/examples/server_side/pipeline.html
Basically the modified fnServerData() function will edit the request made to the server, asking for more information than is required. Then when the user requests that the next page be shown, this function will intercept the call the server (it's not needed) and give DataTables the required information from it's cache.
Of course interaction such as filtering or sorting will cause the pipeline to be flushed, but sending a little extra data that might be flushed is cheap compared to making XHR requests for each page to display (typically the most common interaction with a DataTable).
Hope some of you using server-side processing find this useful :-)
Allan
This discussion has been closed.
Replies
Both browsers show "Show 10 entries" though. Do you have IE7 to hand?
Oops - thanks for spotting that. That will teach me for thinking "it's just data processing - what could go wrong in IE...". I wasn't giving 'splice' a second parameter, which is required in IE and Opera (looks like it is in the ECMAScript spec - doh) - add that in as the length of the array to cut off what isn't needed on the the draw allows it to work as expected.
Allan