# HG changeset patch # User Dustin Demuth # Date 1429538860 -7200 # Node ID 2e8da590ea0c092f1ae888c8594ce22783389ec2 # Parent efb1369a8caca8fd153f490a60b6f058d28c90ba made Comboboces editable and filterable for; Messungenform: Messstelle,Datenbasis,Betriebsarts,Testdatensatz,Preobenart,Netzbetreiber Messungform: Messmethode Messwertegrid: Messgroesse,Messeinheit diff -r efb1369a8cac -r 2e8da590ea0c app/controller/grid/Messwert.js --- a/app/controller/grid/Messwert.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/controller/grid/Messwert.js Mon Apr 20 16:07:40 2015 +0200 @@ -27,9 +27,15 @@ gridSave: function(editor, context) { context.record.save({ success: function(request, response) { - Ext.data.StoreManager.get('messgroessen').clearFilters(); - Ext.data.StoreManager.get('messgroessen').reload(); - // If you don't do the reset above, the grid will only contain + if (Ext.data.StoreManager.get('messeinheiten')) { + Ext.data.StoreManager.get('messeinheiten').clearFilter(); + Ext.data.StoreManager.get('messeinheiten').reload(); + } + if (Ext.data.StoreManager.get('messeinheiten')) { + Ext.data.StoreManager.get('messgroessen').clearFilter(); + Ext.data.StoreManager.get('messgroessen').reload(); + } + // If you don't do the resets above, the grid will only contain // one row in cases in when autocompletion was used! context.grid.store.reload(); context.grid.up('window').initData(); diff -r efb1369a8cac -r 2e8da590ea0c app/store/Messmethoden.js --- a/app/store/Messmethoden.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/store/Messmethoden.js Mon Apr 20 16:07:40 2015 +0200 @@ -13,7 +13,12 @@ extend: 'Ext.data.Store', model: 'Lada.model.Messmethode', sorters: [{ + property: 'id', + direction: 'ASC' + }, + { property: 'messmethode', + direction: 'ASC', transform: function(val) { if (val) { return val.toLowerCase(); @@ -21,5 +26,6 @@ return ''; } }], - autoLoad: true + autoLoad: true, + sortOnLoad: true }); diff -r efb1369a8cac -r 2e8da590ea0c app/view/form/Probe.js --- a/app/view/form/Probe.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/form/Probe.js Mon Apr 20 16:07:40 2015 +0200 @@ -84,7 +84,8 @@ name: 'mstId', fieldLabel: 'Messstelle', labelWidth: 135, - allowBlank: false + allowBlank: false, + editable: true }, { xtype: 'tfield', name: 'hauptprobenNr', diff -r efb1369a8cac -r 2e8da590ea0c app/view/grid/Messwert.js --- a/app/view/grid/Messwert.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/grid/Messwert.js Mon Apr 20 16:07:40 2015 +0200 @@ -120,7 +120,13 @@ displayField: 'einheit', valueField: 'id', allowBlank: false, - editable: false + editable: true, + forceSelection: true, + autoSelect: true, + queryMode: 'local', + minChars: 0, + typeAhead: false, + triggerAction: 'all' } }, { header: '<NWG', diff -r efb1369a8cac -r 2e8da590ea0c app/view/widget/Betriebsart.js --- a/app/view/widget/Betriebsart.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/widget/Betriebsart.js Mon Apr 20 16:07:40 2015 +0200 @@ -8,13 +8,14 @@ var betriebsartStore = Ext.create('Ext.data.Store', { fields: ['betriebsartId', 'betriebsart'], + storeId: 'betriebsartStore', data: [{ 'betriebsartId': '1', - 'betriebsart': 'Normal-/Routinebtrieb' + 'betriebsart': 'Normal-/Routinebetrieb' }, { 'betriebsartId': '2', 'betriebsart': 'Störfall/Intensivbetrieb' - }] + }], }); /** @@ -23,13 +24,18 @@ Ext.define('Lada.view.widget.Betriebsart', { extend: 'Lada.view.widget.base.ComboBox', alias: 'widget.betriebsart', - store: betriebsartStore, + store: 'betriebsartStore', queryMode: 'local', + triggerAction: 'all', + typeAhead: false, + displayField: 'betriebsart', valueField: 'betriebsartId', emptyText: 'Wählen Sie eine Betriebsart', initComponent: function() { + this.store = Ext.data.StoreManager.get('betriebsartStore') + this.store.clearFilter(); this.callParent(arguments); } }); diff -r efb1369a8cac -r 2e8da590ea0c app/view/widget/Datenbasis.js --- a/app/view/widget/Datenbasis.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/widget/Datenbasis.js Mon Apr 20 16:07:40 2015 +0200 @@ -17,17 +17,18 @@ valueField: 'id', emptyText: 'Wählen Sie eine Datenbasis', // Enable filtering of comboboxes - autoSelect: false, queryMode: 'local', triggerAction: 'all', typeAhead: false, - minChars: 0, initComponent: function() { this.store = Ext.data.StoreManager.get('datenbasis'); if (!this.store) { this.store = Ext.create('Lada.store.Datenbasis'); } + else { + this.store.clearFilter(); + } this.callParent(arguments); } }); diff -r efb1369a8cac -r 2e8da590ea0c app/view/widget/Messeinheit.js --- a/app/view/widget/Messeinheit.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/widget/Messeinheit.js Mon Apr 20 16:07:40 2015 +0200 @@ -17,7 +17,6 @@ valueField: 'id', emptyText: 'Wählen Sie eine Messeinheit', // Enable filtering of comboboxes - autoSelect: false, queryMode: 'local', triggerAction: 'all', typeAhead: false, @@ -28,6 +27,9 @@ if (!this.store) { this.store = Ext.create('Lada.store.Messeinheiten'); } + else { + this.store.clearFilter(); + } this.callParent(arguments); } }); diff -r efb1369a8cac -r 2e8da590ea0c app/view/widget/Messmethode.js --- a/app/view/widget/Messmethode.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/widget/Messmethode.js Mon Apr 20 16:07:40 2015 +0200 @@ -17,7 +17,6 @@ valueField: 'id', emptyText: 'Wählen Sie eine Messmethode', // Enable filtering of comboboxes - autoSelect: false, queryMode: 'local', triggerAction: 'all', typeAhead: true, @@ -29,6 +28,9 @@ if (!this.store) { this.store = Ext.create('Lada.store.Messmethoden'); } + else { + this.store.clearFilter(); + } this.callParent(arguments); } }); diff -r efb1369a8cac -r 2e8da590ea0c app/view/widget/Messstelle.js --- a/app/view/widget/Messstelle.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/widget/Messstelle.js Mon Apr 20 16:07:40 2015 +0200 @@ -16,9 +16,10 @@ displayField: 'messStelle', valueField: 'id', editable: this.editable || false, + forceSelection: true, emptyText: 'Wählen Sie eine Messstelle', // Enable filtering of comboboxes - autoSelect: false, + autoSelect: true, queryMode: 'local', triggerAction: 'all', typeAhead: false, diff -r efb1369a8cac -r 2e8da590ea0c app/view/widget/Netzbetreiber.js --- a/app/view/widget/Netzbetreiber.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/widget/Netzbetreiber.js Mon Apr 20 16:07:40 2015 +0200 @@ -17,7 +17,6 @@ valueField: 'id', emptyText: 'Wählen Sie einen Netzbetreiber', // Enable filtering of comboboxes - autoSelect: false, queryMode: 'local', triggerAction: 'all', typeAhead: false, @@ -28,6 +27,9 @@ if (!this.store) { this.store = Ext.create('Lada.store.Netzbetreiber'); } + else { + this.store.clearFilter(); + } this.callParent(arguments); } }); diff -r efb1369a8cac -r 2e8da590ea0c app/view/widget/Probenart.js --- a/app/view/widget/Probenart.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/widget/Probenart.js Mon Apr 20 16:07:40 2015 +0200 @@ -17,7 +17,6 @@ valueField: 'id', emptyText: 'Wählen Sie eine Probenart', // Enable filtering of comboboxes - autoSelect: false, queryMode: 'local', triggerAction: 'all', typeAhead: false, @@ -28,6 +27,9 @@ if (!this.store) { this.store = Ext.create('Lada.store.Probenarten'); } + else { + this.store.clearFilter(); + } this.callParent(arguments); } }); diff -r efb1369a8cac -r 2e8da590ea0c app/view/widget/Testdatensatz.js --- a/app/view/widget/Testdatensatz.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/widget/Testdatensatz.js Mon Apr 20 16:07:40 2015 +0200 @@ -7,6 +7,17 @@ */ +var testdatensatzStore = Ext.create('Ext.data.Store', { + fields: ['testdatensatzId', 'testdatensatz'], + storeId: 'testdatensatzStore', + data: [{ + 'testdatensatzId': true, + 'testdatensatz': 'Ja' + }, { + 'testdatensatzId': false, + 'testdatensatz': 'Nein' + }] +}); /** * Combobox for Testdatensatz. @@ -15,22 +26,19 @@ Ext.define('Lada.view.widget.Testdatensatz', { extend: 'Lada.view.widget.base.ComboBox', alias: 'widget.testdatensatz', + store: 'testdatensatzStore', queryMode: 'local', + triggerAction: 'all', + typeAhead: false, + minChars: 0, + displayField: 'testdatensatz', valueField: 'testdatensatzId', emptyText: 'Testdatensatz?', initComponent: function() { - this.store = Ext.create('Ext.data.Store', { - fields: ['testdatensatzId', 'testdatensatz'], - data: [{ - 'testdatensatzId': true, - 'testdatensatz': 'Ja' - }, { - 'testdatensatzId': false, - 'testdatensatz': 'Nein' - }] - }); + this.store = Ext.data.StoreManager.get('testdatensatzStore') + this.store.clearFilter(); this.callParent(arguments); } }); diff -r efb1369a8cac -r 2e8da590ea0c app/view/widget/base/ComboBox.js --- a/app/view/widget/base/ComboBox.js Mon Apr 20 14:11:39 2015 +0200 +++ b/app/view/widget/base/ComboBox.js Mon Apr 20 16:07:40 2015 +0200 @@ -29,14 +29,14 @@ displayField: this.displayField, valueField: this.valueField, emptyText: this.emptyText, - autoSelect: this.autoSelect, + autoSelect: this.autoSelect || true, queryMode: this.queryMode, triggerAction: this.triggerAction, typeAhead: this.typeAhead, minChars: this.minChars, multiSelect: this.multiSelect, - editable: this.editable || false, - forceSelection: this.forceSelection, + editable: this.editable || true, + forceSelection: this.forceSelection || true, msgTarget: 'none', tpl: this.tpl, displayTpl: this.displayTpl