torsten@341: /** torsten@341: * Viewport for the Lada-Client torsten@341: * torsten@341: * The viewport initialises the graphical elements of the application. For torsten@341: * debugging it is possible to initialize other components directly see the torsten@341: * initComponent function. torsten@341: */ torsten@12: Ext.define('Lada.view.Viewport' ,{ torsten@12: extend: 'Ext.container.Viewport', torsten@12: requires: [ torsten@259: 'Lada.store.Info', torsten@259: 'Lada.view.search.List', torsten@28: 'Lada.view.search.List', torsten@245: 'Lada.view.proben.List', torsten@245: 'Lada.view.widgets.Mst', torsten@245: 'Lada.view.widgets.Uwb', torsten@245: 'Lada.view.widgets.Datetime' torsten@12: ], torsten@12: initComponent: function() { torsten@12: console.log('Setting up Viewport'); torsten@184: this.initSearch(); torsten@173: torsten@173: // Development related: torsten@173: // Disable "initSearch" call and enable one of the following init torsten@173: // methods to get a dialog directly without the need to click through torsten@173: // the whole application. torsten@230: //this.initProbe(); torsten@180: //this.initOrt(); torsten@184: //this.initMessung(); torsten@184: //this.initMesswert(); torsten@173: torsten@259: this.setInfo(); torsten@173: this.callParent(arguments); torsten@173: }, torsten@341: /** torsten@341: * Set some information about user, client and server version in the top torsten@341: * of the application window. The data will be fetched from the server. torsten@341: */ torsten@259: setInfo: function() { torsten@259: var store = Ext.create('Lada.store.Info'); torsten@259: store.load({ torsten@259: callback: function(a,b,c) { torsten@259: var info = store.data.items[0]; torsten@262: var clientVersion = "r261 (2013-07-26)"; torsten@259: var user = info.get('user'); torsten@259: var groups = info.get('groups'); torsten@259: var serverVersion = info.get('version'); torsten@259: var info = Ext.getCmp('systeminfo'); torsten@259: info.update('Nutzer: '+user+' | Gruppe(n): '+groups+' | Server: '+serverVersion+' | Client: '+clientVersion); torsten@259: info.show(); torsten@259: console.log(info); torsten@259: } torsten@259: }); torsten@259: }, torsten@341: /** torsten@341: * Function to initialize the edit window for a priticular probe directly torsten@341: * @private torsten@341: */ torsten@230: initProbe: function() { torsten@230: var store = Ext.getStore('Proben'); torsten@230: store.load({ torsten@230: params: { torsten@230: probeId: "000007575943X" torsten@230: }, torsten@230: callback: function() { torsten@230: var mstore = Ext.getStore('Messungen'); torsten@230: mstore.load({ torsten@230: params: { torsten@230: probeId: "000007575943X" torsten@230: } torsten@230: }); torsten@230: var model = store.data.items[0]; torsten@230: var win = Ext.create('Lada.view.proben.Edit', {model: model}); torsten@230: } torsten@230: }); torsten@230: }, torsten@341: /** torsten@341: * Function to initialize the edit window for a priticular messwert directly torsten@341: * @private torsten@341: */ torsten@180: initMesswert: function() { torsten@180: var store = Ext.getStore('Messwerte'); torsten@180: store.load({ torsten@180: params: { torsten@180: probeId: "000007575853X", torsten@180: messungsId: "1" torsten@184: }, torsten@184: callback: function() { torsten@184: var model = store.data.items[0]; torsten@184: var win = Ext.create('Lada.view.messwerte.Create', {model: model}); torsten@180: } torsten@180: }); torsten@180: }, torsten@341: /** torsten@341: * Function to initialize the edit window for a priticular ort directly torsten@341: * @private torsten@341: */ torsten@180: initOrt: function() { torsten@180: var ort = Ext.create('Lada.model.Ort'); torsten@180: var win = Ext.create('Lada.view.orte.Create', {model: ort}); torsten@180: }, torsten@341: /** torsten@341: * Function to initialize the edit window for a priticular ort directly torsten@341: * @private torsten@341: */ torsten@173: initMessung: function() { torsten@180: var store = Ext.getStore('Messungen'); torsten@180: var kstore = Ext.getStore('MKommentare'); torsten@184: var mstore = Ext.getStore('Messwerte'); torsten@184: var sstore = Ext.getStore('Status'); torsten@180: probeId = "000007578314X"; torsten@180: store.load({ torsten@180: params: { torsten@180: probeId: probeId torsten@180: }, torsten@180: callback: function () { torsten@180: console.log(store); torsten@180: var messung = store.data.items[0]; torsten@180: console.log(store.data.items[0]); torsten@180: kstore.load({ torsten@180: params: { torsten@180: probeId: probeId, torsten@214: messungsId: messung.get('id').messungsId torsten@180: } torsten@180: }); torsten@184: sstore.load({ torsten@184: params: { torsten@184: probeId: probeId, torsten@214: messungsId: messung.get('id').messungsId torsten@184: } torsten@184: }); torsten@184: mstore.load({ torsten@184: params: { torsten@184: probeId: probeId, torsten@214: messungsId: messung.get('id').messungsId torsten@184: } torsten@184: }); torsten@184: console.log('Creating Messung window'); torsten@184: //var messung = Ext.create('Lada.model.Messung'); torsten@184: var win = Ext.create('Lada.view.messungen.Create', {model: messung}); torsten@180: } torsten@180: }); torsten@173: }, torsten@341: /** torsten@341: * Function to initialize the search window. This is the default method torsten@341: * called by the {@link Lada.view.Viewport#initComponent initComponent} method. torsten@341: * @private torsten@341: */ torsten@173: initSearch: function() { torsten@12: this.items = { torsten@25: xtype: 'panel', torsten@25: title: '
Probenauswahlmaske
', torsten@25: bodyPadding: '10 10', torsten@25: items: [ torsten@259: // Informationen über Nutzer/Gruppe/Version torsten@259: { torsten@259: xtype: 'panel', torsten@259: id: 'systeminfo', torsten@259: bodyPadding: '5', torsten@259: hidden: true, torsten@259: }, torsten@31: // Auswahl einer Abfrage. torsten@25: { torsten@28: xtype: 'queryselector', torsten@25: margin: '0 0 10 0' torsten@25: }, torsten@25: // Variables settings for the current selected sql statement. torsten@31: { torsten@245: xtype: 'fieldset', torsten@245: id: 'queryfilters', torsten@245: title: 'Variablenbelegung', torsten@245: hidden: true, torsten@245: items: [ torsten@245: { torsten@245: id: 'filter-mstId', torsten@245: xtype: 'mst', torsten@245: fieldLabel: 'Messstelle', torsten@245: labelWidth: 100, torsten@245: hidden: true torsten@245: }, torsten@245: { torsten@245: id: 'filter-umwId', torsten@245: xtype: 'uwb', torsten@245: fieldLabel: 'Umweltbereich', torsten@245: labelWidth: 100, torsten@245: hidden: true torsten@245: }, torsten@245: { torsten@250: id: 'filter-pbegin', torsten@245: xtype: 'datetime', torsten@245: fieldLabel: 'Probenbeginn', torsten@245: labelWidth: 100, torsten@245: hidden: true torsten@245: } torsten@245: ] torsten@31: }, torsten@120: // Buttons to trigger the search. torsten@31: { torsten@31: id: 'SearchBtnPanel', torsten@31: xtype: 'panel', torsten@31: border: false, torsten@31: margin: '0 0 10 0', torsten@31: items: [ torsten@31: { torsten@31: id: 'SearchBtn', torsten@31: text: 'Suchen', torsten@31: xtype: 'button', torsten@31: margin: '0 10 0 0' torsten@31: }, torsten@31: { torsten@31: id: 'ResetBtn', torsten@31: text: 'Zurücksetzen', torsten@31: xtype: 'button' torsten@31: } torsten@31: ], torsten@148: hidden: false torsten@31: torsten@31: }, torsten@25: // Resultlist for the query. torsten@25: { torsten@25: id: 'result', torsten@31: xtype: 'probenlist', torsten@148: hidden: false torsten@25: } torsten@25: ] torsten@12: }; torsten@12: } torsten@12: });