diff app/view/form/Probe.js @ 717:f124d24c8ade

Datevalidation. When editing a timeperiod in a Probeform it is validated wheter begindate is before enddate. This only happens when the blur-event is fired. ToDo: Listen to Events from the Übernehmen Button of the DateTimePicker, ToDo: Somehow the ErrorMessages are not Cleared correctly when the form is restored.
author Dustin Demuth <dustin@intevation.de>
date Mon, 13 Apr 2015 16:22:34 +0200
parents 0391425689ed
children 7f11b75e0188
line wrap: on
line diff
--- a/app/view/form/Probe.js	Wed Apr 08 17:03:59 2015 +0200
+++ b/app/view/form/Probe.js	Mon Apr 13 16:22:34 2015 +0200
@@ -233,8 +233,9 @@
                         align: 'stretch'
                     },
                     items: [{
-                        xtype: 'fieldset',
+                        xtype: 'fset',
                         title: 'Probenentnahme',
+                        name: 'entnahmePeriod',
                         anchor: '100%',
                         width: '50%',
                         margin: '0, 5, 5, 5',
@@ -248,18 +249,21 @@
                             labelWidth: 90,
                             anchor: '100%',
                             name: 'probeentnahmeBeginn',
-                            format: 'd.m.Y H:i'
+                            format: 'd.m.Y H:i',
+                            period: 'start'
                         }, {
                             xtype: 'datetime',
                             fieldLabel: 'Ende',
                             labelWidth: 90,
                             anchor: '100%',
                             name: 'probeentnahmeEnde',
-                            format: 'd.m.Y H:i'
+                            format: 'd.m.Y H:i',
+                            period: 'end'
                         }]
                     }, {
-                        xtype: 'fieldset',
+                        xtype: 'fset',
                         title: 'Sollzeitraum',
+                        name: 'sollzeitPeriod',
                         anchor: '100%',
                         width: '50%',
                         margin: '0, 5, 5, 5',
@@ -273,14 +277,16 @@
                             labelWidth: 90,
                             anchor: '100%',
                             name: 'solldatumBeginn',
-                            format: 'd.m.Y H:i'
+                            format: 'd.m.Y H:i',
+                            period: 'start'
                         }, {
                             xtype: 'datetime',
                             fieldLabel: 'Bis',
                             labelWidth: 90,
                             anchor: '100%',
                             name: 'solldatumEnde',
-                            format: 'd.m.Y H:i'
+                            format: 'd.m.Y H:i',
+                            period: 'end'
                         }]
                     }]
                 }]
@@ -290,6 +296,7 @@
     },
 
     setRecord: function(record) {
+        this.clearMessages();
         this.getForm().loadRecord(record);
     },
 
@@ -343,6 +350,8 @@
         this.down('datetime[name=solldatumBeginn]').clearWarningOrError();
         this.down('datetime[name=solldatumEnde]').clearWarningOrError();
         //this.down('numberfield[name=probeNehmerId]').clearWarningOrError();
+        this.down('fset[name=entnahmePeriod]').clearMessages();
+        this.down('fset[name=sollzeitPeriod]').clearMessages();
     },
 
     setReadOnly: function(value) {

http://lada.wald.intevation.org