Mercurial > lada > lada-client
diff 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 |
line wrap: on
line diff
--- a/app/view/grid/Status.js Mon Nov 09 12:53:36 2015 +0100 +++ b/app/view/grid/Status.js Mon Nov 09 13:31:43 2015 +0100 @@ -46,8 +46,10 @@ }); this.plugins = [this.rowEditing]; - var statusStore = Ext.create('Lada.store.StatusWerte'); - statusStore.load(); + var statusWerteStore = Ext.create('Lada.store.StatusWerte'); + statusWerteStore.load(); + var statusStufeStore = Ext.create('Lada.store.StatusStufe'); + statusStufeStore.load(); this.dockedItems = [{ xtype: 'toolbar', dock: 'bottom', @@ -90,17 +92,43 @@ }, sortable: false, }, { + header: 'Stufe', + dataIndex: 'statusStufe', + renderer: function(value) { + if (value===null || value === '' || value === 0) { + return 'Fehlerhafte Daten'; + } + var r = statusStufeStore.getById(value).get('stufe') + if (r === null) { + r = 'Error'; + } + return r; + }, + editor: { + xtype: 'combobox', + store: statusStufeStore, + displayField: 'stufe', + valueField: 'id', + allowBlank: false, + editable: false + }, + sortable: false, + }, { header: 'Status', dataIndex: 'statusWert', renderer: function(value) { if (value===null || value === '') { return ''; } - return statusStore.getById(value).get('wert'); + var r = statusWerteStore.getById(value).get('wert') + if (r === null) { + r = 'Error'; + } + return r; }, editor: { xtype: 'combobox', - store: statusStore, + store: statusWerteStore, displayField: 'wert', valueField: 'id', allowBlank: false,