Mercurial > lada > lada-client
comparison app/view/window/MessungEdit.js @ 590:e440b66a859f
Added grid (+controller) for messwerte.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 11 Mar 2015 15:23:16 +0100 |
parents | 424802824648 |
children | a81dafe06d1d |
comparison
equal
deleted
inserted
replaced
589:4c97717b92da | 590:e440b66a859f |
---|---|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out | 5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
6 * the documentation coming with IMIS-Labordaten-Application for details. | 6 * the documentation coming with IMIS-Labordaten-Application for details. |
7 */ | 7 */ |
8 | 8 |
9 /* | 9 /* |
10 * Window to edit a Messung | 10 * Window to edit a Messung |
11 */ | 11 */ |
12 Ext.define('Lada.view.window.MessungEdit', { | 12 Ext.define('Lada.view.window.MessungEdit', { |
13 extend: 'Ext.window.Window', | 13 extend: 'Ext.window.Window', |
14 alias: 'widget.messungedit', | 14 alias: 'widget.messungedit', |
15 | 15 |
16 requires: [ | 16 requires: [ |
17 'Lada.view.form.Messung' | 17 'Lada.view.form.Messung', |
18 // 'Lada.view.grid.Messwert', | 18 'Lada.view.grid.Messwert' |
19 // 'Lada.view.grid.Messstatus', | 19 // 'Lada.view.grid.Messstatus', |
20 // 'Lada.view.grid.MKommentar' | 20 // 'Lada.view.grid.MKommentar' |
21 ], | 21 ], |
22 | 22 |
23 collapsible: true, | 23 collapsible: true, |
26 autoscroll: true, | 26 autoscroll: true, |
27 layout: 'fit', | 27 layout: 'fit', |
28 | 28 |
29 record: null, | 29 record: null, |
30 | 30 |
31 initComponent: function(){ | 31 initComponent: function() { |
32 if (this.record === null) { | 32 if (this.record === null) { |
33 Ext.Msg.alert('Keine valide Messung ausgewählt!'); | 33 Ext.Msg.alert('Keine valide Messung ausgewählt!'); |
34 this.callParent(arguments); | 34 this.callParent(arguments); |
35 return; | 35 return; |
36 } | 36 } |
37 this.title = 'Messung ';// + this.record.get('messungId'); | 37 this.title = 'Messung ' + this.record.get('nebenprobenNr'); |
38 this.buttons = [{ | 38 this.buttons = [{ |
39 text: 'Schließen', | 39 text: 'Schließen', |
40 scope: this, | 40 scope: this, |
41 handler: this.close | 41 handler: this.close |
42 }]; | 42 }]; |
46 this.items = [{ | 46 this.items = [{ |
47 border: 0, | 47 border: 0, |
48 autoScroll: true, | 48 autoScroll: true, |
49 items: [{ | 49 items: [{ |
50 xtype: 'messungform', | 50 xtype: 'messungform', |
51 // recordId: record.get('id') | 51 recordId: this.record.get('id') |
52 }, { | 52 }, { |
53 xtype: 'fset', | 53 xtype: 'fset', |
54 name: 'messwerte', | 54 name: 'messwerte', |
55 title: 'Messwerte - Stub' | 55 title: 'Messwerte', |
56 //todo | 56 padding: '5, 5', |
57 margin: 5, | |
58 items: [{ | |
59 xtype: 'messwertgrid', | |
60 recordId: this.record.get('id') | |
61 }] | |
62 // TODO | |
57 }, { | 63 }, { |
58 xtype: 'fset', | 64 xtype: 'fset', |
59 name: 'messungstatus', | 65 name: 'messungstatus', |
60 title: 'Messungstatus - Stub' | 66 title: 'Messungstatus - Stub' |
61 //todo | 67 // TODO |
62 }, { | 68 }, { |
63 xtype: 'fset', | 69 xtype: 'fset', |
64 name: 'messungskommentare', | 70 name: 'messungskommentare', |
65 title: 'Messungskommentare - Stub' | 71 title: 'Messungskommentare - Stub' |
66 //todo | 72 // TODO |
67 }] | 73 }] |
68 }]; | 74 }]; |
69 this.callParent(arguments); | 75 this.callParent(arguments); |
70 }, | 76 }, |
71 | 77 |
72 initData: function() { | 78 initData: function() { |
73 this.clearMessages(); | 79 this.clearMessages(); |
74 Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), { | 80 Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), { |
75 failure: function(record, action){ | 81 failure: function(record) { |
76 // todo | 82 // TODO |
77 console.log("failure"); | 83 console.log(record); |
78 }, | 84 }, |
79 success: function(record, action){ | 85 success: function(record, response) { |
80 console.log("success"); | 86 this.down('messungform').setRecord(record); |
87 var json = Ext.decode(response.response.responseText); | |
88 if (json) { | |
89 this.setMessages(json.errors, json.warnings); | |
90 } | |
81 }, | 91 }, |
82 scope: this | 92 scope: this |
83 } | 93 } |
84 ); | 94 ); |
85 }, | 95 }, |