changeset 1044:8e579acfe0b1

Set preselected messstelle in status editor.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 25 Feb 2016 10:39:17 +0100
parents 91f65b9cc2fb
children d859fbfc8a53
files app/controller/grid/Status.js app/view/grid/Status.js
diffstat 2 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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
         }, {

http://lada.wald.intevation.org