Mercurial > lada > lada-client
comparison app/view/window/ProbeEdit.js @ 1033:e4b6b6c5fb89
Use 'owner' attribute to set messung grid and button RO status.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 18 Feb 2016 11:19:25 +0100 |
parents | 9ac03f461ab4 |
children | 4d4de99bbe53 |
comparison
equal
deleted
inserted
replaced
1032:fa04558f35cd | 1033:e4b6b6c5fb89 |
---|---|
135 console.log(record); | 135 console.log(record); |
136 }, | 136 }, |
137 success: function(record, response) { | 137 success: function(record, response) { |
138 this.down('probeform').setRecord(record); | 138 this.down('probeform').setRecord(record); |
139 this.record = record; | 139 this.record = record; |
140 owner = this.record.get('owner'); | 140 var owner = this.record.get('owner'); |
141 var readonly = this.record.get('readonly'); | |
141 | 142 |
142 if (owner) { | 143 if (owner) { |
143 //Always allow to Add Messungen. | 144 //Always allow to Add Messungen. |
144 me.enableAddMessungen(); | 145 me.enableAddMessungen(); |
145 } | 146 } |
150 if (!json.warnings.mediaDesk) { | 151 if (!json.warnings.mediaDesk) { |
151 this.down('probeform').setMediaDesk(record); | 152 this.down('probeform').setMediaDesk(record); |
152 } | 153 } |
153 } | 154 } |
154 // If the Probe is ReadOnly, disable Inputfields and grids | 155 // If the Probe is ReadOnly, disable Inputfields and grids |
155 if (this.record.get('readonly') === true) { | 156 if (readonly === true || !owner) { |
156 this.down('probeform').setReadOnly(true); | 157 this.down('probeform').setReadOnly(true); |
157 this.disableChildren(); | 158 this.disableChildren(); |
158 } | 159 } |
159 else { | 160 else { |
160 this.down('probeform').setReadOnly(false); | 161 this.down('probeform').setReadOnly(false); |