Mercurial > lada > lada-client
annotate app/view/widget/Deskriptor.js @ 834:2214aea9fd3a 2.0.1
Patched correct file of r. 832
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Tue, 16 Jun 2015 10:23:53 +0200 |
parents | afdbe3770b99 |
children | 8de4ec66d0e6 |
rev | line source |
---|---|
770
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 * |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 */ |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 /** |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 * Combobox for Deskriptor |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 */ |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.view.widget.Deskriptor', { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 extend: 'Lada.view.widget.base.ComboBox', |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 alias: 'widget.deskriptor', |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 displayField: 'beschreibung', |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 valueField: 'id', |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 // Enable filtering of comboboxes |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 triggerAction: 'all', |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 typeAhead: false, |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 layer: null, |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 queryMode: 'local', |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 listeners: { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 expand: { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 fn: function(field) { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 if (field.up('deskriptor').layer === 0) { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 field.store.proxy.extraParams = {'layer': field.up('deskriptor').layer}; |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 field.store.load(); |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 } |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 else { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 var parents = field.up('deskriptor').getParents(this); |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 if (parents !== '') { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 field.store.proxy.extraParams = { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 'layer': field.up('deskriptor').layer, |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 'parents': parents |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 }; |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 field.store.load(); |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 } |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 } |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 } |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 } |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 }, |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 initComponent: function() { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 this.store = Ext.create('Lada.store.Deskriptoren'); |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 this.callParent(arguments); |
783
afdbe3770b99
Exclude deskriptor fields from form.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
770
diff
changeset
|
47 this.down('combobox').isFormField = false; |
770
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 }, |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 getParents: function(field) { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 var set = field.up('fieldset'); |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 var allS = set.items.items; |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 var p = ''; |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 for (var i = 0; i < field.up('deskriptor').layer; i++) { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 if (allS[i].getValue() > 0) { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 p += allS[i].getValue(); |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 if (i < field.up('deskriptor').layer - 1) { |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 p += ', '; |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 } |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 } |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 } |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 return p; |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 } |
3185a77e8501
Added combobox widget for deskriptoren.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 }); |