comparison app/view/window/ProbeEdit.js @ 684:69cb367c0a63

When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
author Dustin Demuth <dustin@intevation.de>
date Wed, 25 Mar 2015 15:04:45 +0100
parents f373446325b4
children 6a6d1b02a1a3
comparison
equal deleted inserted replaced
683:612f4f933083 684:69cb367c0a63
51 this.items = [{ 51 this.items = [{
52 border: 0, 52 border: 0,
53 autoScroll: true, 53 autoScroll: true,
54 items: [{ 54 items: [{
55 xtype: 'probeform', 55 xtype: 'probeform',
56 recordId: this.record.get('id'), 56 recordId: this.record.get('id')
57 readonly: this.record.get('readonly')
58 }, { 57 }, {
59 xtype: 'fset', 58 xtype: 'fset',
60 name: 'messungen', 59 name: 'messungen',
61 title: 'Messungen', 60 title: 'Messungen',
62 padding: '5, 5', 61 padding: '5, 5',
77 xtype: 'ortgrid', 76 xtype: 'ortgrid',
78 recordId: this.record.get('id') 77 recordId: this.record.get('id')
79 }] 78 }]
80 }, { 79 }, {
81 xtype: 'fset', 80 xtype: 'fset',
82 name: 'probenzusaetzwerte', 81 name: 'probenzusatzwerte',
83 title: 'Zusatzwerte', 82 title: 'Zusatzwerte',
84 padding: '5, 5', 83 padding: '5, 5',
85 margin: 5, 84 margin: 5,
86 collapsible: true, 85 collapsible: true,
87 collapsed: true, 86 collapsed: true,
119 this.setMessages(json.errors, json.warnings); 118 this.setMessages(json.errors, json.warnings);
120 } 119 }
121 }, 120 },
122 scope: this 121 scope: this
123 }); 122 });
123 if (this.record.get('readonly') == true){
124 this.down('probeform').setReadOnly(true);
125 this.disableChildren();
126 }
127 },
128
129 disableChildren: function(){
130 this.down('fset[name=messungen]').down('messunggrid').setReadOnly(true);
131 this.down('fset[name=orte]').down('ortgrid').setReadOnly(true);
132 this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').setReadOnly(true);
133 this.down('fset[name=pkommentare]').down('pkommentargrid').setReadOnly(true);
134 },
135
136 enableChildren: function(){
137 this.down('fset[name=messungen]').down('messunggrid').setReadOnly(false);
138 this.down('fset[name=orte]').down('ortgrid').setReadOnly(false);
139 this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').setReadOnly(false);
140 this.down('fset[name=pkommentare]').down('pkommentargrid').setReadOnly(false);
124 }, 141 },
125 142
126 setMessages: function(errors, warnings) { 143 setMessages: function(errors, warnings) {
127 this.down('probeform').setMessages(errors, warnings); 144 this.down('probeform').setMessages(errors, warnings);
128 var errorOrtText = ''; 145 var errorOrtText = '';

http://lada.wald.intevation.org