[Lada-commits] [PATCH 3 of 5] Set preselected messstelle in status editor

Wald Commits scm-commit at wald.intevation.org
Fri Feb 26 09:41:48 CET 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1456393157 -3600
# Node ID 8e579acfe0b160e8361a859accdb65b1594776f0
# Parent  91f65b9cc2fbcfb56161d9a91b5feb052a7b2d9c
Set preselected messstelle in status editor.

diff -r 91f65b9cc2fb -r 8e579acfe0b1 app/controller/grid/Status.js
--- a/app/controller/grid/Status.js	Thu Feb 25 10:38:13 2016 +0100
+++ b/app/controller/grid/Status.js	Thu Feb 25 10:39:17 2016 +0100
@@ -136,6 +136,9 @@
             var record = Ext.create('Lada.model.Status', {
                 messungsId: button.up('statusgrid').recordId
             });
+            if (Ext.data.StoreManager.get('messstellenFiltered').count() === 1) {
+                record.set('erzeuger', Ext.data.StoreManager.get('messstellenFiltered').getAt(0).get('id'));
+            }
         }
 
         //Set the Date
diff -r 91f65b9cc2fb -r 8e579acfe0b1 app/view/grid/Status.js
--- a/app/view/grid/Status.js	Thu Feb 25 10:38:13 2016 +0100
+++ b/app/view/grid/Status.js	Thu Feb 25 10:39:17 2016 +0100
@@ -104,13 +104,8 @@
                 displayField: 'messStelle',
                 valueField: 'id',
                 allowBlank: false,
-                editable: false,
-                afterRender: function() {
-                    this.superclass.afterRender.apply(this, arguments);
-                    if (this.store.count() === 1) {
-                        this.setValue(this.store.getAt(0));
-                    }
-                }
+                queryMode: 'local',
+                editable: false
             },
             sortable: false
         }, {


More information about the Lada-commits mailing list