comparison app/controller/FilterManagement.js @ 1015:af9879d72310

Updated UI, added window for filter management and added fieldset for query details.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 02 Feb 2016 15:25:16 +0100
parents
children
comparison
equal deleted inserted replaced
1010:94a6b5415d73 1015:af9879d72310
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 *
11 */
12 Ext.define('Lada.controller.FilterManagement', {
13 extend: 'Ext.app.Controller',
14
15 /**
16 * @private
17 * Initialize the controller.
18 */
19 init: function() {
20 var me = this;
21 this.control({
22 'filtermanagement grid favcolumn': {
23 checkchange: me.checkchange
24 },
25 'filtermanagement': {
26 close: me.windowClosed
27 }
28 });
29 },
30
31 checkchange: function(column, ndx, value) {
32 var store = column.up('grid').store;
33 var record = store.getAt(ndx);
34 if (value) {
35 Ext.Ajax.request({
36 url: 'lada-server/rest/favorite',
37 method: 'POST',
38 jsonData: {
39 'queryId': record.get('id')
40 },
41 success: function() {
42 record.set('favorite', true);
43 }
44 });
45 }
46 else {
47 Ext.Ajax.request({
48 url: 'lada-server/rest/favorite?queryId=' + record.get('id'),
49 method: 'DELETE',
50 success: function() {
51 record.set('favorite', false);
52 }
53 });
54 }
55 },
56
57 windowClosed: function() {
58 var combobox = Ext.ComponentQuery.query('combobox[name=filter]')[0];
59 this.getController('Lada.controller.Filter').updateFilter(combobox);
60 }
61 });

http://lada.wald.intevation.org