Updating pipelining cache when using jeditable

Updating pipelining cache when using jeditable

d7a7z7e7dd7a7z7e7d Posts: 8Questions: 0Answers: 0
edited March 2011 in General
I'm using pipelining and getting my data server side. I'm also using jeditable. There is a problem where when I update one of the columns using jeditable, the cached data that the pipelining uses does not get updated so the table is being redrawn with the old data. If I refresh the page, I will see the new data. I saw some suggestions that said to just clear the pipelining cache after updating the column, but I'm pulling in a considerable amount of data and don't want to have to reload the entire table if somebody just makes a change to a single column.

How would I go about updating the pipelining cache when I make a change to a column, without having to reload the cache entirely? I have access to the row and column that the data update occurred in, it shouldn't be too hard to just update that column in the cache directly, should it?

Replies

  • d7a7z7e7dd7a7z7e7d Posts: 8Questions: 0Answers: 0
    I figured it out. You can update the pipelining cache like this:

    [code]
    "fnDrawCallback": function() {
    $('td.input', oTable.fnGetNodes()).editable( 'index.php?route=catalog/product/editDataTable', {
    "callback": function( sValue, y ) {
    var aPos = oTable.fnGetPosition( this );
    oCache.lastJson.aaData[aPos[0][aPos[1]] = sValue;
    oTable.fnUpdate( sValue, aPos[0], aPos[1] );
    },
    "submitdata": function ( value, settings ) {
    return {
    "row_id": this.parentNode.getAttribute('id'),
    "column": oTable.fnGetPosition( this )[2]
    };
    }
    });
    }
    [/code]
  • EdgeEdge Posts: 11Questions: 0Answers: 0
    I am also having the same cache problem, and couldn't get it fixed with above solution. I am using Symfony 1.4, JQuery and JEditable.

    Please check out this code:

    [code]
    $('#example tbody td').click( function () {


    /* Get the position of the current data from the node */
    var aPos = oTable.fnGetPosition( this );

    /* Get the data array for this row */
    var aData = oTable.fnGetData( aPos[0] );
    var d = new Date();
    var data_id = aData[0]*d.getMilliseconds();

    //oCache.lastJson.aData[aPos[0][aPos[1]] = sValue;
    //oTable.fnUpdate( sValue, aPos[0], aPos[1] );

    //alert("aData:"+data_id);

    // data_id is a unique ID which must be sent and which is coming from cache
    $('td.cSelect').editable('<?php echo url_for('symfony_module/get_data?rid=') ?>'+data_id, {

    data : '<?php print json_encode($array); ?>',
    id : data_id,
    type : 'select',
    submit : 'OK'



    });
    /* Update the data array and return the value */
    aData[ aPos[1] ] = 'clicked';
    this.innerHTML = 'Select';
    } );
    [/code]

    any solution will be appreciated???
This discussion has been closed.