changeset 1037:56922c5c21fd

Preselect erzeuger if combobox contains only one object.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 18 Feb 2016 13:35:54 +0100
parents 5ed859241fc9
children 1251094e7500
files app/view/grid/Status.js
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/grid/Status.js	Thu Feb 18 11:48:41 2016 +0100
+++ b/app/view/grid/Status.js	Thu Feb 18 13:35:54 2016 +0100
@@ -104,7 +104,13 @@
                 displayField: 'messStelle',
                 valueField: 'id',
                 allowBlank: false,
-                editable: false
+                editable: false,
+                afterRender: function() {
+                    this.superclass.afterRender.apply(this, arguments);
+                    if (this.store.count() === 1) {
+                        this.setValue(this.store.getAt(0));
+                    }
+                }
             },
             sortable: false
         }, {

http://lada.wald.intevation.org