Skip to content

Instantly share code, notes, and snippets.

@jszmajda
Created July 27, 2010 19:19
Show Gist options
  • Save jszmajda/492704 to your computer and use it in GitHub Desktop.
Save jszmajda/492704 to your computer and use it in GitHub Desktop.
$('#bidding .editable').editable('/loads/<%[email protected]%>/manifest_entries/edit_in_place.ajax', {
'id': 'elementid',
'name': 'elementname',
'callback': function(result,settings){
var field = $(this).attr('class').split(/ /).pop();
if(field.match(/_cents$/)){
$(this).html(result.manifest_entry.manifest_entry[field]/100).formatCurrency();
} else {
$(this).html(result.manifest_entry.manifest_entry[field]);
}
eval(result.sums_for);
update_manifest_values()
},
'ajaxoptions': {dataType: 'json'},
'submitdata': function(value,settings){
var id = $(this).parent('tr').attr('id').split(/-/)[1];
var field = $(this).attr('class').split(/ /).pop();
field = field.replace(/_cents$/,'');
var data = {'id': id,'attr':field};
data[field] = $(this).find('input').val();
return data;
}
@jszmajda
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment