comparison app/view/orte/List.js @ 510:1643d74a40bb

Make tables editable for 'Orte' See LSB 3.5
author Roland Geider <roland.geider@intevation.de>
date Mon, 15 Dec 2014 10:49:40 +0100
parents 8b4ec61c5752
children 6de00657cd87
comparison
equal deleted inserted replaced
509:4ac3eee22f96 510:1643d74a40bb
23 }, 23 },
24 24
25 probeId: null, 25 probeId: null,
26 26
27 initComponent: function() { 27 initComponent: function() {
28 var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
29 clicksToMoveEditor: 1,
30 autoCancel: false
31 });
32
33 this.plugins = [rowEditing];
34
28 this.store = Ext.data.StoreManager.get('Orte'); 35 this.store = Ext.data.StoreManager.get('Orte');
29 if (!this.store) { 36 if (!this.store) {
30 this.store = Ext.create('Lada.store.Orte'); 37 this.store = Ext.create('Lada.store.Orte');
31 } 38 }
32 this.dockedItems = [{ 39 this.dockedItems = [{
43 action: 'delete' 50 action: 'delete'
44 }] 51 }]
45 }]; 52 }];
46 this.columns = [{ 53 this.columns = [{
47 header: 'Typ', 54 header: 'Typ',
48 dataIndex: 'ortsTyp' 55 dataIndex: 'ortsTyp',
56 editor: {
57 allowBlank: false
58 }
49 }, { 59 }, {
50 header: 'Staat', 60 header: 'Staat',
51 dataIndex: 'ortId', 61 dataIndex: 'ortId',
52 renderer: function(value) { 62 renderer: function(value) {
53 var store = Ext.data.StoreManager.get('staOrte'); 63 var store = Ext.data.StoreManager.get('staOrte');
74 Ext.data.StoreManager.get('staVerwaltungseinheiten'); 84 Ext.data.StoreManager.get('staVerwaltungseinheiten');
75 var record = store.getById(value); 85 var record = store.getById(value);
76 var gemid = record.get('gemId'); 86 var gemid = record.get('gemId');
77 var record2 = gemeinden.getById(gemid); 87 var record2 = gemeinden.getById(gemid);
78 return record2.get('bezeichnung'); 88 return record2.get('bezeichnung');
79 } 89 },
90 //editor: {
91 // allowBlank: false
92 //}
80 }, { 93 }, {
81 header: 'Messpunkt', 94 header: 'Messpunkt',
82 dataIndex: 'ortId', 95 dataIndex: 'ortId',
83 renderer: function(value) { 96 renderer: function(value) {
84 var store = Ext.getStore('staOrte'); 97 var store = Ext.getStore('staOrte');
85 var record = store.getById(value); 98 var record = store.getById(value);
86 return record.get('bezeichnung'); 99 return record.get('bezeichnung');
87 } 100 },
101 //editor: {
102 // allowBlank: false
103 //}
88 }]; 104 }];
89 this.callParent(arguments); 105 this.callParent(arguments);
90 } 106 }
91 }); 107 });

http://lada.wald.intevation.org