comparison app/view/grid/Probenzusatzwert.js @ 571:1dedce48e3e1

Implemented the 'add' button; fixed renderer and controller.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 10 Mar 2015 12:11:50 +0100
parents 9a414a49dffe
children f59bda7551d7
comparison
equal deleted inserted replaced
570:1f6a22107c8c 571:1dedce48e3e1
25 margin: '0, 5, 5, 5', 25 margin: '0, 5, 5, 5',
26 26
27 recordId: null, 27 recordId: null,
28 28
29 initComponent: function() { 29 initComponent: function() {
30 var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { 30 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
31 clicksToMoveEditor: 1, 31 clicksToMoveEditor: 1,
32 autoCancel: false 32 autoCancel: false
33 }); 33 });
34 this.plugins = [rowEditing]; 34 this.plugins = [this.rowEditing];
35 this.dockedItems = [{ 35 this.dockedItems = [{
36 xtype: 'toolbar', 36 xtype: 'toolbar',
37 dock: 'bottom', 37 dock: 'bottom',
38 items: ['->', { 38 items: ['->', {
39 text: 'Hinzufügen', 39 text: 'Hinzufügen',
53 }, { 53 }, {
54 header: 'PZW-Größe', 54 header: 'PZW-Größe',
55 dataIndex: 'pzsId', 55 dataIndex: 'pzsId',
56 flex: 1, 56 flex: 1,
57 renderer: function(value) { 57 renderer: function(value) {
58 if (!value || value === '') {
59 return '';
60 }
58 var store = Ext.data.StoreManager.get('probenzusaetze'); 61 var store = Ext.data.StoreManager.get('probenzusaetze');
59 var record = store.getById(value); 62 var record = store.getById(value);
60 return record.get('beschreibung'); 63 return record.get('beschreibung');
61 }, 64 },
62 editor: { 65 editor: {
83 }, { 86 }, {
84 header: 'Maßeinheit', 87 header: 'Maßeinheit',
85 dataIndex: 'pzsId', 88 dataIndex: 'pzsId',
86 width: 80, 89 width: 80,
87 renderer: function(value) { 90 renderer: function(value) {
91 if (!value || value === '') {
92 return '';
93 }
88 var zstore = Ext.data.StoreManager.get('probenzusaetze'); 94 var zstore = Ext.data.StoreManager.get('probenzusaetze');
89 var mstore = Ext.data.StoreManager.get('messeinheiten'); 95 var mstore = Ext.data.StoreManager.get('messeinheiten');
90 var mehId = zstore.getById(value).get('mehId'); 96 var mehId = zstore.getById(value).get('mehId');
91 var record = mstore.findRecord('id', mehId); 97 var record = mstore.findRecord('id', mehId);
92 return record.get('einheit'); 98 return record.get('einheit');

http://lada.wald.intevation.org