Created
July 27, 2010 19:19
-
-
Save jszmajda/492704 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using http://www.appelsiini.net/projects/jeditable