Mercurial > lada > lada-client
comparison app/view/messwerte/List.js @ 525:5960189e4461
Make tables editable for 'Messwerte'
See LSB 3.5
author | Roland Geider <roland.geider@intevation.de> |
---|---|
date | Tue, 16 Dec 2014 18:21:19 +0100 |
parents | 6de00657cd87 |
children | 95bad130be98 0eb7751ce158 |
comparison
equal
deleted
inserted
replaced
524:8972f008dfb1 | 525:5960189e4461 |
---|---|
25 | 25 |
26 probeId: null, | 26 probeId: null, |
27 parentId: null, | 27 parentId: null, |
28 | 28 |
29 initComponent: function() { | 29 initComponent: function() { |
30 var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { | |
31 clicksToMoveEditor: 1, | |
32 autoCancel: false | |
33 }); | |
34 | |
35 this.plugins = [rowEditing]; | |
36 | |
30 this.dockedItems = [{ | 37 this.dockedItems = [{ |
31 xtype: 'toolbar', | 38 xtype: 'toolbar', |
32 dock: 'bottom', | 39 dock: 'bottom', |
33 items: ['->', { | 40 items: ['->', { |
34 text: 'Hinzufügen', | 41 text: 'Hinzufügen', |
42 action: 'delete' | 49 action: 'delete' |
43 }] | 50 }] |
44 }]; | 51 }]; |
45 this.columns = [{ | 52 this.columns = [{ |
46 header: '<NWG', | 53 header: '<NWG', |
47 dataIndex: 'messwertNwg' | 54 dataIndex: 'messwertNwg', |
55 editor: { | |
56 allowBlank: false | |
57 } | |
48 }, { | 58 }, { |
49 header: 'Messwert', | 59 header: 'Messwert', |
50 dataIndex: 'messwert' | 60 dataIndex: 'messwert', |
61 editor: { | |
62 xtype: 'numberfield', | |
63 allowBlank: false | |
64 } | |
51 }, { | 65 }, { |
52 header: 'Messfehler', | 66 header: 'Messfehler', |
53 dataIndex: 'messfehler' | 67 dataIndex: 'messfehler', |
68 editor: { | |
69 xtype: 'numberfield', | |
70 allowBlank: false | |
71 } | |
54 }, { | 72 }, { |
55 header: 'Messgröße', | 73 header: 'Messgröße', |
56 dataIndex: 'messgroesseId', | 74 dataIndex: 'messgroesseId', |
57 renderer: function(value) { | 75 renderer: function(value) { |
58 var store = Ext.data.StoreManager.get('staMessgroessen'); | 76 var store = Ext.data.StoreManager.get('staMessgroessen'); |
59 return store.findRecord('id', value).get('messgroesse'); | 77 return store.findRecord('id', value).get('messgroesse'); |
78 }, | |
79 editor: { | |
80 xtype: 'messgroesse', | |
81 allowBlank: false | |
60 } | 82 } |
61 }, { | 83 }, { |
62 header: 'Messeinheit', | 84 header: 'Messeinheit', |
63 dataIndex: 'mehId', | 85 dataIndex: 'mehId', |
64 renderer: function(value) { | 86 renderer: function(value) { |
65 var store = Ext.data.StoreManager.get('staMesseinheiten'); | 87 var store = Ext.data.StoreManager.get('staMesseinheiten'); |
66 return store.findRecord('id', value).get('einheit'); | 88 return store.findRecord('id', value).get('einheit'); |
89 }, | |
90 editor: { | |
91 xtype: 'messeinheit', | |
92 allowBlank: false | |
67 } | 93 } |
68 }, { | 94 }, { |
69 header: 'Grenzwertüberschreitung', | 95 header: 'Grenzwertüberschreitung', |
70 dataIndex: 'grenzwertueberschreitung', | 96 dataIndex: 'grenzwertueberschreitung', |
71 flex: 1, | 97 flex: 1, |
72 renderer: function(value) { | 98 renderer: function(value) { |
73 if (value === true) { | 99 if (value === true) { |
74 return 'Ja'; | 100 return 'Ja'; |
75 } | 101 } |
76 return 'Nein'; | 102 return 'Nein'; |
103 }, | |
104 editor: { | |
105 xtype: 'checkboxfield' | |
77 } | 106 } |
78 }]; | 107 }]; |
79 this.callParent(arguments); | 108 this.callParent(arguments); |
80 } | 109 } |
81 }); | 110 }); |