Mercurial > lada > lada-client
comparison app/view/grid/Status.js @ 990:c2a726887dd7
The last status can not be edited anymore. When a new status is added, the new record is preset with ALL previous variables, this includes the StatusStufe! The Date is corrected to the current date. Also the store is sorted by Datum now.
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Wed, 16 Dec 2015 09:49:09 +0100 |
parents | d4603049cd42 |
children | 092e245b13a4 |
comparison
equal
deleted
inserted
replaced
989:b892eb346f14 | 990:c2a726887dd7 |
---|---|
35 statusStufeStore.load(); | 35 statusStufeStore.load(); |
36 | 36 |
37 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { | 37 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { |
38 clicksToMoveEditor: 1, | 38 clicksToMoveEditor: 1, |
39 autoCancel: false, | 39 autoCancel: false, |
40 disabled: true, | 40 disabled: true, //has no effect... but why? |
41 pluginId: 'rowedit' | 41 pluginId: 'rowedit', |
42 listeners: { | |
43 beforeedit: function(editor, context, eOpts) { | |
44 if (context.record.get('id') || | |
45 ! context.grid.up('window').record.get('statusEdit')) { | |
46 //Check if edit is allowed, this is true, when the selected | |
47 // Record has an id (=is not new) | |
48 // or is not allowed to add records. | |
49 | |
50 return false; | |
51 } | |
52 | |
53 | |
54 } | |
55 } | |
42 }); | 56 }); |
43 this.plugins = [this.rowEditing]; | 57 this.plugins = [this.rowEditing]; |
44 | 58 |
45 this.dockedItems = [{ | 59 this.dockedItems = [{ |
46 xtype: 'toolbar', | 60 xtype: 'toolbar', |
145 initData: function() { | 159 initData: function() { |
146 if (this.store) { | 160 if (this.store) { |
147 this.store.removeAll(); | 161 this.store.removeAll(); |
148 } | 162 } |
149 else { | 163 else { |
150 this.store = Ext.create('Lada.store.Status'); | 164 this.store = Ext.create('Lada.store.Status',{ |
165 sorters: [{ | |
166 property: 'datum', | |
167 direction: 'ASC' | |
168 }] | |
169 }); | |
151 } | 170 } |
152 this.store.load({ | 171 this.store.load({ |
153 params: { | 172 params: { |
154 messungsId: this.recordId | 173 messungsId: this.recordId, |
155 } | 174 } |
156 }); | 175 }); |
157 }, | 176 }, |
158 | 177 |
159 setReadOnly: function(b) { | 178 setReadOnly: function(b) { |