comparison app/controller/grid/Messung.js @ 1111:a73726bba79c

Use custom row expander in probe list grid to display messung grid.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 17 May 2016 17:12:07 +0200
parents 6a6f2c6fe8ee
children 0a032c98c3a6
comparison
equal deleted inserted replaced
1110:4a55e665f2d1 1111:a73726bba79c
37 /** 37 /**
38 * This function opens a new {@link Lada.view.window.MessungEdit} 38 * This function opens a new {@link Lada.view.window.MessungEdit}
39 * Window. 39 * Window.
40 */ 40 */
41 editItem: function(grid, record) { 41 editItem: function(grid, record) {
42 var probe = grid.up('window').record; 42 // we have a window with a probe record!
43 /* Only open a new Window when: 43 if (grid.up('window')) {
44 statusEdit = True 44 var probe = grid.up('window').record;
45 -or- 45 /* Only open a new Window when:
46 the value of status is not 0 46 statusEdit = True
47 -or- 47 -or-
48 the owner = True 48 the value of status is not 0
49 -or-
50 the owner = True
49 51
50 the statusWert attribute is not present in the original data. 52 the statusWert attribute is not present in the original data.
51 it is appended, when the value and name of the status were 53 it is appended, when the value and name of the status were
52 determined. 54 determined.
53 */ 55 */
54 if (record.get('statusEdit') 56 if (record.get('statusEdit')
55 || record.get('statusWert') > 0 57 || record.get('statusWert') > 0
56 || record.get('owner')) { 58 || record.get('owner')) {
57 var win = Ext.create('Lada.view.window.MessungEdit', { 59 var win = Ext.create('Lada.view.window.MessungEdit', {
58 parentWindow: grid.up('window'), 60 parentWindow: grid.up('window'),
59 probe: probe, 61 probe: probe,
60 record: record, 62 record: record,
61 grid: grid 63 grid: grid
62 }); 64 });
63 win.show(); 65 win.show();
64 win.initData(); 66 win.initData();
67 }
68 return;
65 } 69 }
70 var probeRecord = Ext.create('Lada.model.ProbeList');
71 probeRecord.setId(record.get('probeId'));
72 probeRecord.set('owner', record.get('owner'));
73 probeRecord.set('readonly', record.get('readonly'));
74
75 var probeWin = Ext.create('Lada.view.window.ProbeEdit', {
76 record: probeRecord,
77 style: 'z-index: -1;' //Fixes an Issue where windows could not be created in IE8
78 });
79
80 probeWin.setPosition(30);
81 probeWin.show();
82 probeWin.initData();
83
84 Ext.ClassManager.get('Lada.model.Probe').load(record.get('probeId'), {
85 failure: function(record, action) {
86 me.setLoading(false);
87 // TODO
88 console.log('An unhandled Failure occured. See following Response and Record');
89 console.log(action);
90 console.log(record);
91 },
92 success: function(precord, response) {
93 var messungWin = Ext.create('Lada.view.window.MessungEdit', {
94 parentWindow: grid.up('window'),
95 probe: precord,
96 record: record,
97 grid: grid
98 });
99 messungWin.show();
100 messungWin.setPosition(window.innerWidth - 30 - messungWin.width);
101 messungWin.initData();
102 }
103 });
66 }, 104 },
67 105
68 /** 106 /**
69 * This function opens a window add a Messung 107 * This function opens a window add a Messung
70 */ 108 */

http://lada.wald.intevation.org