Mercurial > lada > lada-client
diff app/view/grid/Status.js @ 963:6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Thu, 12 Nov 2015 12:13:31 +0100 |
parents | 6f1cc3316e2d |
children | 5b86baa038bc |
line wrap: on
line diff
--- a/app/view/grid/Status.js Thu Nov 12 09:50:48 2015 +0100 +++ b/app/view/grid/Status.js Thu Nov 12 12:13:31 2015 +0100 @@ -25,6 +25,15 @@ allowDeselect: true, initComponent: function() { + var statusWerteStore = Ext.create('Lada.store.StatusWerte'); + statusWerteStore.load({ + params: { + messungsId: this.recordId + } + }); + var statusStufeStore = Ext.create('Lada.store.StatusStufe'); + statusStufeStore.load(); + this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { clicksToMoveEditor: 1, autoCancel: false, @@ -46,18 +55,6 @@ }); this.plugins = [this.rowEditing]; - var statusWerteStore = Ext.create('Lada.store.StatusWerte'); - statusWerteStore.load({ - //params: { - // messungsId: this.recordId - //} - }); - var statusStufeStore = Ext.create('Lada.store.StatusStufe'); - statusStufeStore.load({ - //params: { - // messungsId: this.recordId - //} - }); this.dockedItems = [{ xtype: 'toolbar', dock: 'bottom', @@ -108,11 +105,12 @@ header: 'Stufe', dataIndex: 'statusStufe', renderer: function(value) { + var sta = Ext.data.StoreManager.get('statusstufe'); var r; if (value===null || value === '') { r = 'Error'; } - var item = statusStufeStore.getById(value); + var item = sta.getById(value); if (item) { r = item.get('stufe'); } @@ -123,11 +121,13 @@ header: 'Status', dataIndex: 'statusWert', renderer: function(value) { + var sta = Ext.data.StoreManager.get('statuswerte'); + //This store is NOT used in the editor... var r; if (value===null || value === '') { r = 'Error'; } - var item = statusWerteStore.getById(value); + var item = sta.getById(value); if (item) { r = item.get('wert'); }