Pipeline & POST

Pipeline & POST

elmezieelmezie Posts: 7Questions: 0Answers: 0
edited October 2009 in General
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?

Replies

  • elmezieelmezie Posts: 7Questions: 0Answers: 0
    I know that you have to use .post instead of getJson , but after that. i get confused
  • elmezieelmezie Posts: 7Questions: 0Answers: 0
    Ok, figured it out.

    For anyone wondering.

    in the function fnDataTablesPipeline

    change

    $.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 );

    fnCallback(json)
    } );

    TO

    jQuery.post( 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 );

    fnCallback(data)
    },"json" );


    This appears to work. Basically its saying instead of using GET use POST and then return the POST data as json
  • elmezieelmezie Posts: 7Questions: 0Answers: 0
    Allan, is there a way to cache all previously viewed pages?
  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    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.

    Regards,
    Allan
  • tt13tt13 Posts: 5Questions: 0Answers: 0
    Please take a look at this question http://datatables.net/forums/discussion/9878/server-side-processing-with-pipelining
This discussion has been closed.