changeset 926:c75f13578315

Changed 'Solldatum' fields to readonly fields without default value.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 11 Sep 2015 14:18:52 +0200
parents 81e7c847cb58
children a1783726d43e
files app/model/Probe.js app/view/form/Probe.js app/view/widget/base/Datetime.js
diffstat 3 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/app/model/Probe.js	Fri Sep 11 12:20:20 2015 +0200
+++ b/app/model/Probe.js	Fri Sep 11 14:18:52 2015 +0200
@@ -104,8 +104,7 @@
                 return v;
             }
             return new Date(v);
-        },
-        defaultValue: new Date()
+        }
     }, {
         name: 'solldatumEnde',
         type: 'date',
@@ -114,8 +113,7 @@
                 return v;
             }
             return new Date(v);
-        },
-        defaultValue: new Date()
+        }
     }, {
         name: 'readonly',
         type: 'boolean',
--- a/app/view/form/Probe.js	Fri Sep 11 12:20:20 2015 +0200
+++ b/app/view/form/Probe.js	Fri Sep 11 14:18:52 2015 +0200
@@ -193,20 +193,24 @@
                         },
                         items: [{
                             xtype: 'datetime',
+                            emptyText: ' ',
                             fieldLabel: 'Sollzeitraum von',
                             labelWidth: 120,
                             margin: '0, 5, 5, 5',
                             name: 'solldatumBeginn',
                             format: 'd.m.Y H:i',
-                            period: 'start'
+                            period: 'start',
+                            readOnly: true
                         }, {
                             xtype: 'datetime',
+                            emptyText: ' ',
                             fieldLabel: 'bis',
                             labelWidth: 10,
                             margin: '0, 5, 5, 5',
                             name: 'solldatumEnde',
                             format: 'd.m.Y H:i',
-                            period: 'end'
+                            period: 'end',
+                            readOnly: true
                         }]
                     }, {
                         xtype: 'fset',
@@ -427,8 +431,6 @@
         this.down('cbox[name=umwId]').setReadOnly(value);
         this.down('datetime[name=probeentnahmeBeginn]').setReadOnly(value);
         this.down('datetime[name=probeentnahmeEnde]').setReadOnly(value);
-        this.down('datetime[name=solldatumBeginn]').setReadOnly(value);
-        this.down('datetime[name=solldatumEnde]').setReadOnly(value);
         this.down('numberfield[name=probeNehmerId]').setReadOnly(value);
 
         //Deskriptoren
--- a/app/view/widget/base/Datetime.js	Fri Sep 11 12:20:20 2015 +0200
+++ b/app/view/widget/base/Datetime.js	Fri Sep 11 14:18:52 2015 +0200
@@ -25,14 +25,16 @@
     initComponent: function() {
         var dateField = Ext.create('Lada.view.widget.base.DateTimeField', {
             format: this.format || 'd.m.Y H:i',
-            emptyText: 'Wählen Sie einen Zeitpunkt',
+            emptyText: this.emptyText || 'Wählen Sie einen Zeitpunkt',
             fieldLabel: this.fieldLabel,
             labelWidth: this.labelWidth,
             flex: 1,
             name: this.name,
             msgTarget: 'none',
             listeners: this.listeners,
-            period: this.period
+            readOnly: this.readOnly || false,
+            period: this.period,
+            value: this.value
         });
         this.items = [dateField, {
             xtype: 'image',

http://lada.wald.intevation.org