changeset 749:78e73be45aaa

Change store on radiobutton change for proben and messprogramm.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 28 Apr 2015 10:57:50 +0200
parents 344330d3d1cd
children 561ade69980e
files app/controller/ProbenPlanungSwitcher.js app/model/Messprogramm.js app/model/Query.js app/store/Queries.js app/view/FilterPanel.js
diffstat 5 files changed, 13 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/ProbenPlanungSwitcher.js	Tue Apr 28 10:56:41 2015 +0200
+++ b/app/controller/ProbenPlanungSwitcher.js	Tue Apr 28 10:57:50 2015 +0200
@@ -14,6 +14,10 @@
     extend: 'Ext.app.Controller',
     displayFields: null,
 
+    requires: [
+        'Lada.store.MessprogrammQueries'
+    ],
+
     /**
      * Initialize this Controller
      * It has 1 Listeners
@@ -36,12 +40,14 @@
      */
     switchStores: function(field) {
         var cbox = field.up('probenplanungswitcher').up().down('combobox');
+        var resultGrid = field.up('panel[name=main]').down('filterresultgrid');
 
-        if (field.inputValue == "probenplanung" && cbox) {
-            var sname = 'Lada.store.Queries'; // TODO change store!
+        var sname = 'Lada.store.ProbeQueries';
+        if (field.inputValue === 'probenplanung' && cbox) {
+            sname = 'Lada.store.MessprogrammQueries'; // TODO change store!
         }
-        else if (field.inputValue == "probenliste" && cbox) {
-            var sname = 'Lada.store.Queries';
+        else if (field.inputValue === 'probenliste' && cbox) {
+            sname = 'Lada.store.ProbeQueries';
         }
 
         var store = Ext.StoreManager.lookup(sname);
--- a/app/model/Messprogramm.js	Tue Apr 28 10:56:41 2015 +0200
+++ b/app/model/Messprogramm.js	Tue Apr 28 10:57:50 2015 +0200
@@ -80,7 +80,7 @@
 
     proxy: {
         type: 'rest',
-        //url: 'lada-server/messprogramm', //not yet implemented
+        url: 'lada-server/messprogramm', //not yet implemented
         reader: {
             type: 'json',
             root: 'data'
--- a/app/model/Query.js	Tue Apr 28 10:56:41 2015 +0200
+++ b/app/model/Query.js	Tue Apr 28 10:57:50 2015 +0200
@@ -28,7 +28,7 @@
 
     proxy: {
         type: 'rest',
-        url: 'lada-server/query',
+        url: 'lada-server/query/probe',
         reader: {
             type: 'json',
             root: 'data'
--- a/app/store/Queries.js	Tue Apr 28 10:56:41 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU GPL (v>=3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out
- * the documentation coming with IMIS-Labordaten-Application for details. 
- */
-
-/**
- * Store for Queries
- */
-Ext.define('Lada.store.Queries', {
-    extend: 'Ext.data.Store',
-    model: 'Lada.model.Query',
-    autoLoad: true
-});
--- a/app/view/FilterPanel.js	Tue Apr 28 10:56:41 2015 +0200
+++ b/app/view/FilterPanel.js	Tue Apr 28 10:57:50 2015 +0200
@@ -27,7 +27,7 @@
             xtype: 'combobox',
             name: 'filter',
             editable: false,
-            store: Ext.create('Lada.store.Queries'),
+            store: Ext.create('Lada.store.ProbeQueries'),
             displayField: 'name',
             valueField: 'id',
             emptyText: 'Wählen Sie eine Abfrage'

http://lada.wald.intevation.org