Mercurial > lada > lada-client
diff app/controller/form/Messung.js @ 742:6e28ebbe1a73
added documentation for Form and Grid controllers
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Thu, 23 Apr 2015 16:28:04 +0200 |
parents | c2a6f7caa71b |
children | 24b5684d74d7 |
line wrap: on
line diff
--- a/app/controller/form/Messung.js Mon Apr 20 16:07:40 2015 +0200 +++ b/app/controller/form/Messung.js Thu Apr 23 16:28:04 2015 +0200 @@ -6,9 +6,16 @@ * the documentation coming with IMIS-Labordaten-Application for details. */ +/** + * This is a controller for a Messung form + */ Ext.define('Lada.controller.form.Messung', { extend: 'Ext.app.Controller', + /** + * Initialize the Controller + * It has 3 listeners + */ init: function() { this.control({ 'messungform button[action=save]': { @@ -23,6 +30,11 @@ }); }, + /** + * The save function saves the content of the Location form. + * On success it will reload the Store, + * on failure, it will display an Errormessage + */ save: function(button) { var formPanel = button.up('form'); formPanel.setLoading(true); @@ -95,12 +107,25 @@ }); }, - discard: function(button) { + /** + * The discard function resets the Location form + * to its original state. + */ + discard: function(button) { var formPanel = button.up('form'); formPanel.getForm().loadRecord(formPanel.getForm().getRecord()); }, - dirtyForm: function(form, dirty) { + /** + * The dirtyForm function enables or disables the save and discard + * button which are present in the toolbar of the form. + * The Buttons are only active if the content of the form was altered + * (the form is dirty). + * In Additon it calls the disableChildren() function of the window + * embedding the form. Only when the record does not carry the readonly + * flag, the function calls the embedding windows enableChilren() function + */ + dirtyForm: function(form, dirty) { if (dirty) { form.owner.down('button[action=save]').setDisabled(false); form.owner.down('button[action=discard]').setDisabled(false);