DataTables logo DataTables

Pipeline & POST
  • It seems that currently when your using the pipeline feature that it uses $_GET .
    $_GET is not available for use on my server . Is there a way to use pipeline with POST?
  • I know that you have to use .post instead of getJson , but after that. i get confused
  • Ok, figured it out.

    For anyone wondering.

    in the function fnDataTablesPipeline


    $.getJSON( sSource, aoData, function (json) {
    /* Callback processing */
    oCache.lastJson = jQuery.extend(true, {}, json);

    if ( oCache.iCacheLower != oCache.iDisplayStart )
    json.aaData.splice( 0, oCache.iDisplayStart-oCache.iCacheLower );
    json.aaData.splice( oCache.iDisplayLength, json.aaData.length );

    } );

    TO sSource, aoData, function (data) {
    /* Callback processing */
    oCache.lastJson = jQuery.extend(true, {}, data);

    if ( oCache.iCacheLower != oCache.iDisplayStart )
    data.aaData.splice( 0, oCache.iDisplayStart-oCache.iCacheLower );
    data.aaData.splice( oCache.iDisplayLength, data.aaData.length );

    },"json" );

    This appears to work. Basically its saying instead of using GET use POST and then return the POST data as json
  • Allan, is there a way to cache all previously viewed pages?
  • Hi elmezie,

    There isn't a method of doing that at the moment - but there is no reason why the pipelining method couldn't be modified to do that if you feel like a hack :-). You'd need to ensure that all the variables match exactly as before (length, sorting, filtering etc) before returning results from the cache, but it would certainly be possible.

This discussion has been closed.
All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Get useful and friendly help straight from the source.