jEditable: edit cell and also update adjacent cell
jEditable: edit cell and also update adjacent cell
I see in the documentation that fnUpdate can either take (the sValue argument) a single value (to update a single cell) or an array to update an entire row. How can I pass the entire row array to fnUpdate in the example code in examle API - editable rows (jEditable):
[code]
var oTable;
$(document).ready(function() {
/* Apply the jEditable handlers to the table */
$('#example tbody td').editable( '../examples_support/editable_ajax.php', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return { "row_id": this.parentNode.getAttribute('id') };
},
"height": "14px"
} );
/* Init DataTables */
oTable = $('#example').dataTable();
} );
[/code]
I do not want to edit the entire row just update an adjacent cell (spreadsheet-like: changing a parameter in one cell, updating the calculated value in another).
thanks in advance,
Timmo
[code]
var oTable;
$(document).ready(function() {
/* Apply the jEditable handlers to the table */
$('#example tbody td').editable( '../examples_support/editable_ajax.php', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return { "row_id": this.parentNode.getAttribute('id') };
},
"height": "14px"
} );
/* Init DataTables */
oTable = $('#example').dataTable();
} );
[/code]
I do not want to edit the entire row just update an adjacent cell (spreadsheet-like: changing a parameter in one cell, updating the calculated value in another).
thanks in advance,
Timmo
This discussion has been closed.