comparison app/view/grid/Status.js @ 956:45c67a784b31

Added StatusStufe to the StatusGrid. Created Store and Model for StatusStufe
author Dustin Demuth <dustin@intevation.de>
date Mon, 09 Nov 2015 13:31:43 +0100
parents c7bf0b459074
children 881984972e0e
comparison
equal deleted inserted replaced
955:b401846e7817 956:45c67a784b31
44 } 44 }
45 } 45 }
46 }); 46 });
47 this.plugins = [this.rowEditing]; 47 this.plugins = [this.rowEditing];
48 48
49 var statusStore = Ext.create('Lada.store.StatusWerte'); 49 var statusWerteStore = Ext.create('Lada.store.StatusWerte');
50 statusStore.load(); 50 statusWerteStore.load();
51 var statusStufeStore = Ext.create('Lada.store.StatusStufe');
52 statusStufeStore.load();
51 this.dockedItems = [{ 53 this.dockedItems = [{
52 xtype: 'toolbar', 54 xtype: 'toolbar',
53 dock: 'bottom', 55 dock: 'bottom',
54 items: ['->', { 56 items: ['->', {
55 text: 'Hinzufügen', 57 text: 'Hinzufügen',
88 allowBlank: false, 90 allowBlank: false,
89 editable: false 91 editable: false
90 }, 92 },
91 sortable: false, 93 sortable: false,
92 }, { 94 }, {
95 header: 'Stufe',
96 dataIndex: 'statusStufe',
97 renderer: function(value) {
98 if (value===null || value === '' || value === 0) {
99 return 'Fehlerhafte Daten';
100 }
101 var r = statusStufeStore.getById(value).get('stufe')
102 if (r === null) {
103 r = 'Error';
104 }
105 return r;
106 },
107 editor: {
108 xtype: 'combobox',
109 store: statusStufeStore,
110 displayField: 'stufe',
111 valueField: 'id',
112 allowBlank: false,
113 editable: false
114 },
115 sortable: false,
116 }, {
93 header: 'Status', 117 header: 'Status',
94 dataIndex: 'statusWert', 118 dataIndex: 'statusWert',
95 renderer: function(value) { 119 renderer: function(value) {
96 if (value===null || value === '') { 120 if (value===null || value === '') {
97 return ''; 121 return '';
98 } 122 }
99 return statusStore.getById(value).get('wert'); 123 var r = statusWerteStore.getById(value).get('wert')
124 if (r === null) {
125 r = 'Error';
126 }
127 return r;
100 }, 128 },
101 editor: { 129 editor: {
102 xtype: 'combobox', 130 xtype: 'combobox',
103 store: statusStore, 131 store: statusWerteStore,
104 displayField: 'wert', 132 displayField: 'wert',
105 valueField: 'id', 133 valueField: 'id',
106 allowBlank: false, 134 allowBlank: false,
107 editable: false 135 editable: false
108 }, 136 },

http://lada.wald.intevation.org