Mercurial > lada > lada-client
comparison app/view/grid/Nuklide.js @ 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
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Fri, 08 May 2015 15:31:58 +0200 |
parents | |
children | 31eaed998531 |
comparison
equal
deleted
inserted
replaced
763:0e8d4178bb7e | 764:ba8c0e754979 |
---|---|
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 * Grid to list Nuklide | |
11 */ | |
12 Ext.define('Lada.view.grid.Nuklide', { | |
13 extend: 'Ext.grid.Panel', | |
14 alias: 'widget.nuklidegrid', | |
15 | |
16 selType: 'checkboxmodel', | |
17 selModel: { | |
18 checkOnly: false, | |
19 injectCheckbox: 0 | |
20 }, | |
21 requires: [ | |
22 'Lada.view.widget.Messgroesse' | |
23 ], | |
24 | |
25 maxHeight: 350, | |
26 minHeight: 110, | |
27 viewConfig: { | |
28 deferEmptyText: false | |
29 }, | |
30 margin: '0, 5, 5, 5', | |
31 | |
32 recordId: null, | |
33 | |
34 initComponent: function() { | |
35 var i18n = Lada.getApplication().bundle; | |
36 this.emptyText = i18n.getMsg('emptytext.nuklidgrid'); | |
37 | |
38 this.dockedItems = [{ | |
39 xtype: 'toolbar', | |
40 dock: 'bottom', | |
41 items: ['->', { | |
42 text: i18n.getMsg('save'), | |
43 qtip: i18n.getMsg('save.qtip'), | |
44 icon: 'resources/img/dialog-ok-apply.png', | |
45 action: 'save', | |
46 disabled: true | |
47 }, { | |
48 text: i18n.getMsg('discard'), | |
49 qtip: i18n.getMsg('discard.qtip'), | |
50 icon: 'resources/img/dialog-cancel.png', | |
51 action: 'discard', | |
52 disabled: true | |
53 }] | |
54 }]; | |
55 this.columns = [{ | |
56 header: i18n.getMsg('nuklid'), | |
57 dataIndex: 'id', | |
58 flex: 1, | |
59 renderer: function(value) { | |
60 if (!value || value === '') { | |
61 return ''; | |
62 } | |
63 var store = Ext.data.StoreManager.get('messgroessen'); | |
64 if (!store) { | |
65 store = Ext.create('Lada.store.Messgroessen'); | |
66 } | |
67 return store.findRecord('id', value, 0, false, false, true).get('messgroesse'); | |
68 } | |
69 }]; | |
70 this.initData(); | |
71 this.callParent(arguments); | |
72 }, | |
73 initData: function() { | |
74 if (this.store) { | |
75 this.store.removeAll(); | |
76 } | |
77 }, | |
78 setData: function(store) { | |
79 this.setLoading(true); | |
80 this.reconfigure(store); | |
81 this.setLoading(false); | |
82 }, | |
83 setReadOnly: function(b) { | |
84 if (b == true){ | |
85 //Readonly | |
86 if (this.getPlugin('rowedit')){ | |
87 this.getPlugin('rowedit').disable(); | |
88 } | |
89 this.down('button[action=discard]').disable(); | |
90 this.down('button[action=save]').disable(); | |
91 }else{ | |
92 //Writable | |
93 if (this.getPlugin('rowedit')){ | |
94 this.getPlugin('rowedit').enable(); | |
95 } | |
96 this.down('button[action=discard]').enable(); | |
97 this.down('button[action=save]').enable(); | |
98 } | |
99 } | |
100 }); |