comparison app/view/messungen/EditForm.js @ 518:97a428548a24

Added save and discard button to messung edit head and listen for change event to enable/disable buttons.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 16 Dec 2014 16:56:23 +0100
parents ae8582b4f207
children
comparison
equal deleted inserted replaced
517:89e3725211ca 518:97a428548a24
22 22
23 model: 'Lada.model.Messung', 23 model: 'Lada.model.Messung',
24 minWidth: 650, 24 minWidth: 650,
25 25
26 initComponent: function() { 26 initComponent: function() {
27 var me = this;
27 this.items = [{ 28 this.items = [{
28 xtype: 'fieldset', 29 xtype: 'fieldset',
29 title: 'Allgemein', 30 title: 'Allgemein',
30 items: [{ 31 items: [{
31 layout: { 32 layout: {
32 type: 'table', 33 type: 'table',
33 columns: 2 34 columns: 2
34 }, 35 },
35 border: 0, 36 border: 0,
37 margin: '0, 0, 10, 0',
38 dockedItems: [{
39 xtype: 'toolbar',
40 dock: 'bottom',
41 border: '0, 1, 1, 1',
42 style: {
43 borderBottom: '1px solid #b5b8c8 !important',
44 borderLeft: '1px solid #b5b8c8 !important',
45 borderRight: '1px solid #b5b8c8 !important'
46 },
47 items: ['->', {
48 text: 'Speichern',
49 qtip: 'Daten speichern',
50 icon: 'gfx/dialog-ok-apply.png',
51 action: 'save',
52 scope: me,
53 handler: this.commit
54 }, {
55 text: 'Verwerfen',
56 qtip: 'Ă„nderungen verwerfen',
57 icon: 'gfx/dialog-cancel.png',
58 action: 'discard',
59 disabled: true,
60 scope: me,
61 handler: this.reset
62 }]
63 }],
36 items: [{ 64 items: [{
37 xtype: 'textfield', 65 xtype: 'textfield',
38 name: 'nebenprobenNr', 66 name: 'nebenprobenNr',
39 maxLength: 10, 67 maxLength: 10,
40 margin: '0, 10, 5, 0', 68 margin: '0, 10, 5, 0',
41 fieldLabel: 'Nebenprobennr.' 69 fieldLabel: 'Nebenprobennr.',
70 listeners: {
71 dirtychange: {
72 fn: this.updateOnChange,
73 scope: me
74 }
75 }
42 }, { 76 }, {
43 xtype: 'messmethode', 77 xtype: 'messmethode',
44 name: 'mmtId', 78 name: 'mmtId',
45 margin: '0, 10, 5, 0', 79 margin: '0, 10, 5, 0',
46 fieldLabel: 'Messmethode' 80 fieldLabel: 'Messmethode',
81 listeners: {
82 dirtychange: {
83 fn: this.updateOnChange,
84 scope: me
85 }
86 }
47 }, { 87 }, {
48 xtype: 'datetime', 88 xtype: 'datetime',
49 name: 'messzeitpunkt', 89 name: 'messzeitpunkt',
50 margin: '0, 10, 5, 0', 90 margin: '0, 10, 5, 0',
51 fieldLabel: 'Messzeitpunkt' 91 fieldLabel: 'Messzeitpunkt',
92 listeners: {
93 dirtychange: {
94 fn: this.updateOnChange,
95 scope: me
96 }
97 }
52 }, { 98 }, {
53 xtype: 'numberfield', 99 xtype: 'numberfield',
54 allowDecimals: false, 100 allowDecimals: false,
55 minValue: 0, 101 minValue: 0,
56 name: 'messdauer', 102 name: 'messdauer',
57 margin: '0, 10, 5, 0', 103 margin: '0, 10, 5, 0',
58 fieldLabel: 'Messdauer' 104 fieldLabel: 'Messdauer',
105 listeners: {
106 dirtychange: {
107 fn: this.updateOnChange,
108 scope: me
109 }
110 }
59 }, { 111 }, {
60 xtype: 'testdatensatz', 112 xtype: 'testdatensatz',
61 name: 'fertig', 113 name: 'fertig',
62 margin: '0, 10, 5, 0', 114 margin: '0, 10, 5, 0',
63 fieldLabel: 'Fertig' 115 fieldLabel: 'Fertig',
116 listeners: {
117 dirtychange: {
118 fn: this.updateOnChange,
119 scope: me
120 }
121 }
64 }, { 122 }, {
65 xtype: 'testdatensatz', 123 xtype: 'testdatensatz',
66 name: 'geplant', 124 name: 'geplant',
67 margin: '0, 10, 5, 0', 125 margin: '0, 10, 5, 0',
68 fieldLabel: 'Geplant' 126 fieldLabel: 'Geplant',
127 listeners: {
128 dirtychange: {
129 fn: this.updateOnChange,
130 scope: me
131 }
132 }
69 }] 133 }]
70 }] 134 }]
71 }, { 135 }, {
72 // Messwerte 136 // Messwerte
73 xtype: 'fieldset', 137 xtype: 'fieldset',

http://lada.wald.intevation.org