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: 22,792Questions: 0Answers: 521
    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
This discussion has been closed.