[Lada-commits] [PATCH 1 of 5] Added Offset field

Wald Commits scm-commit at wald.intevation.org
Tue May 12 17:01:11 CEST 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1431439865 -7200
# Node ID afc9076db49053728b00fe1de624d2503f17eb10
# Parent  380edfecac675fded85eca1608483da397836866
Added Offset field

diff -r 380edfecac67 -r afc9076db490 app/controller/form/Messprogramm.js
--- a/app/controller/form/Messprogramm.js	Tue May 12 15:07:23 2015 +0200
+++ b/app/controller/form/Messprogramm.js	Tue May 12 16:11:05 2015 +0200
@@ -26,7 +26,11 @@
             'messprogrammform': {
                 dirtychange: this.dirtyForm
             },
-            'messprogrammform [xtype="numberfield"]': {
+            'messprogrammform numberfield[name=teilintervallBis]': {
+                change: this.synchronizeSlider,
+                blur: this.checkPeriod
+            },
+            'messprogrammform numberfield[name=teilintervallVon]': {
                 change: this.synchronizeSlider,
                 blur: this.checkPeriod
             },
diff -r 380edfecac67 -r afc9076db490 app/model/Messprogramm.js
--- a/app/model/Messprogramm.js	Tue May 12 15:07:23 2015 +0200
+++ b/app/model/Messprogramm.js	Tue May 12 16:11:05 2015 +0200
@@ -59,9 +59,23 @@
     }, {
         name: 'intervallOffset'
     }, {
-        name: 'gueltigVon'
+        name: 'gueltigVon',
+        type: 'date',
+        convert: function(v) {
+            if (!v) {
+                return v;
+            }
+            return new Date(v);
+        },
     }, {
-        name: 'gueltigBis'
+        name: 'gueltigBis',
+        type: 'date',
+        convert: function(v) {
+            if (!v) {
+                return v;
+            }
+            return new Date(v);
+        },
     }, {
         name: 'probeNehmerId'
     }, {
diff -r 380edfecac67 -r afc9076db490 app/view/form/Messprogramm.js
--- a/app/view/form/Messprogramm.js	Tue May 12 15:07:23 2015 +0200
+++ b/app/view/form/Messprogramm.js	Tue May 12 16:11:05 2015 +0200
@@ -256,6 +256,12 @@
                             name: 'gueltigBis',
                             format: 'd.m.Y H:i',
                             period: 'end'
+                        }, {
+                            xtype: 'numberfield',
+                            fieldLabel: i18n.getMsg('offset'),
+                            labelWidth: 90,
+                            anchor: '100%',
+                            name: 'intervallOffset',
                         }]
                     }, {
                         xtype: 'fset',
@@ -310,6 +316,7 @@
         // for instance H, M, J, ...
         // Initialize the probenintervallslider
         var s = this.down('probenintervallslider');
+        var i = this.getForm().findField('intervallOffset');
         var v = this.getForm().findField('teilintervallVon');
         var b = this.getForm().findField('teilintervallBis');
         var intervallstore = Ext.data.StoreManager.get('Probenintervall');
@@ -367,6 +374,10 @@
         v.setValue(svalLower);
         b.setValue(svalUpper);
 
+        //Set IntervallOffset
+        i.setMinValue(0);
+        i.setMaxValue(max-1);
+
         console.log('Populate End');
     },
 
diff -r 380edfecac67 -r afc9076db490 resources/i18n/Lada_de-DE.properties
--- a/resources/i18n/Lada_de-DE.properties	Tue May 12 15:07:23 2015 +0200
+++ b/resources/i18n/Lada_de-DE.properties	Tue May 12 16:11:05 2015 +0200
@@ -61,6 +61,7 @@
 nuklid:Nuklid
 from:Von
 to:Bis
+offset:Offset
 
 emptytext.probenintervall:Wählen Sie ein Probenintervall
 emptytext.datenbasis:Wahlen Sie eine Datenbasis


More information about the Lada-commits mailing list