comparison app/view/messungen/List.js @ 511:83a98b61546a

Make tables editable for 'Messungen' See LSB 3.5
author Roland Geider <roland.geider@intevation.de>
date Mon, 15 Dec 2014 10:50:32 +0100
parents 484e12e89d54
children 6de00657cd87
comparison
equal deleted inserted replaced
510:1643d74a40bb 511:83a98b61546a
22 minHeight: 35, 22 minHeight: 35,
23 deferEmptyText: false 23 deferEmptyText: false
24 }, 24 },
25 25
26 probeId: null, 26 probeId: null,
27
28
27 29
28 initComponent: function() { 30 initComponent: function() {
31 var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
32 clicksToMoveEditor: 1,
33 autoCancel: false
34 });
35
36 this.plugins = [rowEditing];
37
29 this.dockedItems = [{ 38 this.dockedItems = [{
30 xtype: 'toolbar', 39 xtype: 'toolbar',
31 dock: 'top', 40 dock: 'top',
32 items: [{ 41 items: [{
33 text: 'Hinzufügen', 42 text: 'Hinzufügen',
36 probeId: this.probeId 45 probeId: this.probeId
37 }, { 46 }, {
38 text: 'Löschen', 47 text: 'Löschen',
39 icon: 'gfx/list-remove.png', 48 icon: 'gfx/list-remove.png',
40 action: 'delete' 49 action: 'delete'
50 }, {
51 text: 'Öffnen',
52 icon: 'gfx/document-open.png',
53 action: 'open'
41 }] 54 }]
42 }]; 55 }];
43 this.columns = [{ 56 this.columns = [{
44 header: 'Mess.ID', 57 header: 'Mess.ID',
58 editor: {
59 allowBlank: false
60 },
45 dataIndex: 'id', 61 dataIndex: 'id',
46 width: 50 62 width: 50
47 }, { 63 }, {
48 header: 'NPR-Nr.', 64 header: 'NPR-Nr.',
65 editor: {
66 allowBlank: false
67 },
49 dataIndex: 'nebenprobenNr', 68 dataIndex: 'nebenprobenNr',
50 width: 50 69 width: 50
51 }, { 70 }, {
52 header: 'MMT', 71 header: 'MMT',
72 editor: {
73 allowBlank: false
74 },
53 dataIndex: 'mmtId', 75 dataIndex: 'mmtId',
54 width: 50 76 width: 50
55 }, { 77 }, {
56 header: 'Messzeit', 78 header: 'Messzeit',
79 editor: {
80 xtype: 'datefield',
81 allowBlank: false,
82 format: 'd.m.Y',
83 minValue: '01.01.2001', // TODO: gibt es ein minValue?
84 //minText: 'Fehlertext', // TODO: Fehlertext falls minValue
85 maxValue: Ext.Date.format(new Date(), 'd.m.Y')
86 },
57 dataIndex: 'messzeitpunkt' 87 dataIndex: 'messzeitpunkt'
58 }, { 88 }, {
59 header: 'Status', 89 header: 'Status',
60 dataIndex: 'id', 90 dataIndex: 'id',
61 width: 50, 91 width: 50,
69 }); 99 });
70 if (sstore.getTotalCount() === 0) { 100 if (sstore.getTotalCount() === 0) {
71 return 'unbekannt'; 101 return 'unbekannt';
72 } 102 }
73 return sstore.last().get('status'); 103 return sstore.last().get('status');
104 },
105 editor: {
106 xtype: 'numberfield',
107 allowBlank: false,
74 } 108 }
75 }, { 109 }, {
76 header: 'OK-Flag', 110 header: 'OK-Flag',
77 dataIndex: 'fertig', 111 dataIndex: 'fertig',
78 width: 50, 112 width: 50,
79 renderer: function(value) { 113 renderer: function(value) {
80 if (value) { 114 if (value) {
81 return 'Ja'; 115 return 'Ja';
82 } 116 }
83 return 'Nein'; 117 return 'Nein';
118 },
119 editor: {
120 xtype: 'checkboxfield',
121 allowBlank: false,
84 } 122 }
85 }, { 123 }, {
86 header: 'Anzahl Nuklide', 124 header: 'Anzahl Nuklide',
87 dataIndex: 'id', 125 dataIndex: 'id',
88 renderer: function(value) { 126 renderer: function(value) {

http://lada.wald.intevation.org