[Lada-commits] [PATCH] Preselect erzeuger if combobox contains only one object

Wald Commits scm-commit at wald.intevation.org
Thu Feb 18 13:35:58 CET 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1455798954 -3600
# Node ID 56922c5c21fd0b2b735b498d1918af4b30ba6efc
# Parent  5ed859241fc9ccc228edf4bddca2d63937a2a1bd
Preselect erzeuger if combobox contains only one object.

diff -r 5ed859241fc9 -r 56922c5c21fd app/view/grid/Status.js
--- 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
         }, {


More information about the Lada-commits mailing list