annotate app/view/grid/Nuklide.js @ 765:62721a75d31d

A draft on how the Nuklide could be selected... maybe this path can be used
author Dustin Demuth <dustin@intevation.de>
date Fri, 08 May 2015 16:12:01 +0200
parents ba8c0e754979
children 31eaed998531
rev   line source
764
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
3 *
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
7 */
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
8
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
9 /*
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
10 * Grid to list Nuklide
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
11 */
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.grid.Nuklide', {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
13 extend: 'Ext.grid.Panel',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
14 alias: 'widget.nuklidegrid',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
15
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
16 selType: 'checkboxmodel',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
17 selModel: {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
18 checkOnly: false,
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
19 injectCheckbox: 0
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
20 },
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
21 requires: [
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
22 'Lada.view.widget.Messgroesse'
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
23 ],
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
24
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
25 maxHeight: 350,
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
26 minHeight: 110,
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
27 viewConfig: {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
28 deferEmptyText: false
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
29 },
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
30 margin: '0, 5, 5, 5',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
31
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
32 recordId: null,
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
33
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
34 initComponent: function() {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
35 var i18n = Lada.getApplication().bundle;
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
36 this.emptyText = i18n.getMsg('emptytext.nuklidgrid');
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
37
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
38 this.dockedItems = [{
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
39 xtype: 'toolbar',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
40 dock: 'bottom',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
41 items: ['->', {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
42 text: i18n.getMsg('save'),
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
43 qtip: i18n.getMsg('save.qtip'),
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
44 icon: 'resources/img/dialog-ok-apply.png',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
45 action: 'save',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
46 disabled: true
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
47 }, {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
48 text: i18n.getMsg('discard'),
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
49 qtip: i18n.getMsg('discard.qtip'),
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
50 icon: 'resources/img/dialog-cancel.png',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
51 action: 'discard',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
52 disabled: true
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
53 }]
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
54 }];
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
55 this.columns = [{
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
56 header: i18n.getMsg('nuklid'),
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
57 dataIndex: 'id',
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
58 flex: 1,
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
59 renderer: function(value) {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
60 if (!value || value === '') {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
61 return '';
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
62 }
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
63 var store = Ext.data.StoreManager.get('messgroessen');
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
64 if (!store) {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
65 store = Ext.create('Lada.store.Messgroessen');
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
66 }
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
67 return store.findRecord('id', value, 0, false, false, true).get('messgroesse');
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
68 }
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
69 }];
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
70 this.initData();
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
71 this.callParent(arguments);
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
72 },
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
73 initData: function() {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
74 if (this.store) {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
75 this.store.removeAll();
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
76 }
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
77 },
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
78 setData: function(store) {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
79 this.setLoading(true);
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
80 this.reconfigure(store);
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
81 this.setLoading(false);
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
82 },
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
83 setReadOnly: function(b) {
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
84 if (b == true){
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
85 //Readonly
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
86 if (this.getPlugin('rowedit')){
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
87 this.getPlugin('rowedit').disable();
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
88 }
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
89 this.down('button[action=discard]').disable();
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
90 this.down('button[action=save]').disable();
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
91 }else{
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
92 //Writable
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
93 if (this.getPlugin('rowedit')){
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
94 this.getPlugin('rowedit').enable();
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
95 }
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
96 this.down('button[action=discard]').enable();
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
97 this.down('button[action=save]').enable();
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
98 }
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
99 }
ba8c0e754979 Some work was done on the nuklidegrid, added a checkbox model to select the nuklide. Looks OK, but has no function right now
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
100 });

http://lada.wald.intevation.org