[Lada-commits] [PATCH 4 of 5] Filter the selectable Messtellen in the statusgrid

Wald Commits scm-commit at wald.intevation.org
Thu Nov 12 16:15:51 CET 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1447336285 -3600
# Node ID 50d7b6e17525b7c1555a1bf61debaba4df2724d4
# Parent  6e67eb947258586b7ccf28fe482f2babf5d97d3c
Filter the selectable Messtellen in the statusgrid

diff -r 6e67eb947258 -r 50d7b6e17525 app.js
--- a/app.js	Thu Nov 12 14:26:44 2015 +0100
+++ b/app.js	Thu Nov 12 14:51:25 2015 +0100
@@ -164,6 +164,16 @@
             storeId: 'statusstufe',
             autoLoad: 'true'
         });
+        //A Store containing all MST a User is allowed to set.
+        Ext.create('Lada.store.Messstellen', {
+            storeId: 'messstellenFiltered',
+            filters: function(item) {
+                if (Ext.Array.contains(Lada.mst, item.get('id'))) {
+                    return true;
+                }
+                return false;
+            }
+        });
     },
 
     getServerVersion: function() {
diff -r 6e67eb947258 -r 50d7b6e17525 app/controller/form/Probe.js
--- a/app/controller/form/Probe.js	Thu Nov 12 14:26:44 2015 +0100
+++ b/app/controller/form/Probe.js	Thu Nov 12 14:51:25 2015 +0100
@@ -45,6 +45,10 @@
      * The Messtellen Store contains ALL Messtellen.
      * Filter the store in this combobox to reduce the choices
      * to the subset which the user is allowed to use.
+     *
+     * The app.js also creates a messstellenFiltered store,
+     * which contains this selection. Maybe this can be used here in future
+     * TODO
      */
     filter: function(field) {
         var fil =  Ext.create('Ext.util.Filter', {
diff -r 6e67eb947258 -r 50d7b6e17525 app/view/grid/Status.js
--- a/app/view/grid/Status.js	Thu Nov 12 14:26:44 2015 +0100
+++ b/app/view/grid/Status.js	Thu Nov 12 14:51:25 2015 +0100
@@ -90,7 +90,7 @@
             },
             editor: {
                 xtype: 'combobox',
-                store: Ext.data.StoreManager.get('messstellen'),
+                store: Ext.data.StoreManager.get('messstellenFiltered'),
                 displayField: 'messStelle',
                 valueField: 'id',
                 allowBlank: false,


More information about the Lada-commits mailing list