I have a table.
- KeyTable is used for navigation
- jEditable is used to submit to the server
The problem is that the value gets submitted to the server (and is saved in the database) but the actual table does not update
The server string returns:
Parameters: {"row_id"=>"3", "action"=>"post", "col_id"=>"1", "value"=>"text entered into field", "controller"=>"impact_definition_trading", "scenario"=>"1"}
My code:
$('#example tbody td').editable( '<%= url_for :controller => 'impact_definition_trading', :action => 'post', :scenario => params[:id] %>', {
"callback": function( sValue, y ) {
alert(sValue+ "Callback called"+y);
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
alert ("Updating ["+aPos[0]+","+aPos[1]+"] with value of ->" + value);
},
"submitdata": function ( value, settings ) {
return { "row_id": this.parentNode.getAttribute('id') };
},
indicator : 'Saving...',
tooltip : 'Click to edit...',
"height": "14px"
} );
What is odd here, if you look at the callback section, the aPos items correctly get the element that I am editing in the table.
Also - the data is submitted to the server in the variable called value.
The problem seems to be that sValue in "callback" stays blank. This causes
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
to be triggered with a blank value. Thus blanking the table td you just edited.
Where can I get the actual input value from jEditable or jQuery? What is the variable called that is passed as 'value' in a post to the server?
I've stepped through all of jEditable and watched all the incoming, outgoing vars, but can't seem to find what the changed cell item is called.
Thanks in advance for your help. :)