domain: client
language: javascript
class Item class
Call disable_edit_form
to prevent any user actions when
edit_form is visible.
Call enable_edit_form to re-enable edit form.
function on_edit_form_created(item) {
var save_btn = item.add_edit_button('Save and continue');
save_btn.click(function() {
if (item.is_changing()) {
item.disable_edit_form();
item.post();
item.apply(function(error){
if (error) {
item.alert_error(error);
}
item.edit();
item.enable_edit_form();
});
}
});
}