changeset 967:50d7b6e17525

Filter the selectable Messtellen in the statusgrid
author Dustin Demuth <dustin@intevation.de>
date Thu, 12 Nov 2015 14:51:25 +0100
parents 6e67eb947258
children 8fabf9a3fee7
files app.js app/controller/form/Probe.js app/view/grid/Status.js
diffstat 3 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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() {
--- 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', {
--- 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,

http://lada.wald.intevation.org