comparison app/view/grid/Status.js @ 963:6a6f2c6fe8ee

More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
author Dustin Demuth <dustin@intevation.de>
date Thu, 12 Nov 2015 12:13:31 +0100
parents 6f1cc3316e2d
children 5b86baa038bc
comparison
equal deleted inserted replaced
962:9b6800458a9e 963:6a6f2c6fe8ee
23 recordId: null, 23 recordId: null,
24 readOnly: true, 24 readOnly: true,
25 allowDeselect: true, 25 allowDeselect: true,
26 26
27 initComponent: function() { 27 initComponent: function() {
28 var statusWerteStore = Ext.create('Lada.store.StatusWerte');
29 statusWerteStore.load({
30 params: {
31 messungsId: this.recordId
32 }
33 });
34 var statusStufeStore = Ext.create('Lada.store.StatusStufe');
35 statusStufeStore.load();
36
28 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { 37 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
29 clicksToMoveEditor: 1, 38 clicksToMoveEditor: 1,
30 autoCancel: false, 39 autoCancel: false,
31 disabled: true, 40 disabled: true,
32 pluginId: 'rowedit', 41 pluginId: 'rowedit',
44 } 53 }
45 } 54 }
46 }); 55 });
47 this.plugins = [this.rowEditing]; 56 this.plugins = [this.rowEditing];
48 57
49 var statusWerteStore = Ext.create('Lada.store.StatusWerte');
50 statusWerteStore.load({
51 //params: {
52 // messungsId: this.recordId
53 //}
54 });
55 var statusStufeStore = Ext.create('Lada.store.StatusStufe');
56 statusStufeStore.load({
57 //params: {
58 // messungsId: this.recordId
59 //}
60 });
61 this.dockedItems = [{ 58 this.dockedItems = [{
62 xtype: 'toolbar', 59 xtype: 'toolbar',
63 dock: 'bottom', 60 dock: 'bottom',
64 items: ['->', { 61 items: ['->', {
65 text: 'Hinzufügen', 62 text: 'Hinzufügen',
106 sortable: false, 103 sortable: false,
107 }, { 104 }, {
108 header: 'Stufe', 105 header: 'Stufe',
109 dataIndex: 'statusStufe', 106 dataIndex: 'statusStufe',
110 renderer: function(value) { 107 renderer: function(value) {
108 var sta = Ext.data.StoreManager.get('statusstufe');
111 var r; 109 var r;
112 if (value===null || value === '') { 110 if (value===null || value === '') {
113 r = 'Error'; 111 r = 'Error';
114 } 112 }
115 var item = statusStufeStore.getById(value); 113 var item = sta.getById(value);
116 if (item) { 114 if (item) {
117 r = item.get('stufe'); 115 r = item.get('stufe');
118 } 116 }
119 return r; 117 return r;
120 }, 118 },
121 sortable: false, 119 sortable: false,
122 }, { 120 }, {
123 header: 'Status', 121 header: 'Status',
124 dataIndex: 'statusWert', 122 dataIndex: 'statusWert',
125 renderer: function(value) { 123 renderer: function(value) {
124 var sta = Ext.data.StoreManager.get('statuswerte');
125 //This store is NOT used in the editor...
126 var r; 126 var r;
127 if (value===null || value === '') { 127 if (value===null || value === '') {
128 r = 'Error'; 128 r = 'Error';
129 } 129 }
130 var item = statusWerteStore.getById(value); 130 var item = sta.getById(value);
131 if (item) { 131 if (item) {
132 r = item.get('wert'); 132 r = item.get('wert');
133 } 133 }
134 return r; 134 return r;
135 }, 135 },

http://lada.wald.intevation.org