I have a DataTable that is using jEditable so that the user can modify the values held in the 3rd column. The user can only edit column 3 values but looking at the AJAX post it is not sending the 'ID' which is the value held in column 1. Looking at Firebug I see the following during a POST:
column 2
id district
row_id null
value new text
Here is my code, I would like to add a line to the RETURN portion so that it return with the value of the first column [0] for (this)? Not sure how to do this, pretty new to Javascript...
<script>
$(document).ready(function() {
/* Init DataTables */
var oTable = $('#district').dataTable();
/* Apply the jEditable handlers to the table */
$('#district', oTable.fnGetNodes()).editable( 'editable_ajax.php', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1], aPos[2] );
},
"submitdata": function ( value, settings ) {
return {
"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition( this )[2]
};
},
"height": "14px"
} );
} );
</script>
var id2 = oTable.fnGetData( aPos2[0] );