Updating pipelining cache when using jeditable
Updating pipelining cache when using jeditable
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?
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?
This discussion has been closed.
Replies
[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]
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???