comparison app/controller/ProbenPlanungSwitcher.js @ 747:3ffecbce17d6

Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
author Dustin Demuth <dustin@intevation.de>
date Fri, 24 Apr 2015 15:47:05 +0200
parents
children 78e73be45aaa
comparison
equal deleted inserted replaced
746:f99f23ffeb73 747:3ffecbce17d6
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
2 * Software engineering by Intevation GmbH
3 *
4 * This file is Free Software under the GNU GPL (v>=3)
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
6 * the documentation coming with IMIS-Labordaten-Application for details.
7 */
8
9 /**
10 * Controller for the ProbenPlanungSwitcher
11 * This controller handles all logic related to the PPS
12 */
13 Ext.define('Lada.controller.ProbenPlanungSwitcher', {
14 extend: 'Ext.app.Controller',
15 displayFields: null,
16
17 /**
18 * Initialize this Controller
19 * It has 1 Listeners
20 * A checked PPS-Radiofield fired a 'check'-event
21 */
22 init: function() {
23 this.control({
24 'radiofield[name=ppswitch]': {
25 check: this.switchStores
26 }
27 });
28 this.callParent(arguments);
29 },
30
31 /**
32 * Function is called when the user selects a checkbox.
33 * according to the checkboxes inputValue,
34 * the function alters the store which was loaded by the
35 * filterpanels combobox
36 */
37 switchStores: function(field) {
38 var cbox = field.up('probenplanungswitcher').up().down('combobox');
39
40 if (field.inputValue == "probenplanung" && cbox) {
41 var sname = 'Lada.store.Queries'; // TODO change store!
42 }
43 else if (field.inputValue == "probenliste" && cbox) {
44 var sname = 'Lada.store.Queries';
45 }
46
47 var store = Ext.StoreManager.lookup(sname);
48 if (!store) {
49 store = Ext.create(sname);
50 }
51 if (store) {
52 store.load();
53 cbox.bindStore(store);
54 }
55 }
56 });

http://lada.wald.intevation.org