changeset 120:19eab475bbe5

Clean up part one. Reduced application to the search page. Moved some stores for comoboboxes right to the combobox
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 21 Jun 2013 16:53:39 +0200
parents 1a08905b46e2
children c05fda928b82
files app.js app/controller/Sql.js app/store/Mst.js app/store/Sql.js app/store/Uwb.js app/view/Viewport.js app/view/search/List.js app/view/widgets/Mst.js app/view/widgets/Uwb.js
diffstat 9 files changed, 49 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/app.js	Fri Jun 21 16:51:16 2013 +0200
+++ b/app.js	Fri Jun 21 16:53:39 2013 +0200
@@ -26,11 +26,12 @@
     // Define the controllers of the application. They will be initialized
     // first before the application "launch" function is called.
     controllers: [
-        'Proben',
-        'Kommentare',
-        'Sql',
-        'Zusatzwerte',
-        'Orte',
-        'Messungen'
+        'Sql'
+        //'Proben',
+        //'Kommentare',
+        //'Sql',
+        //'Zusatzwerte',
+        //'Orte',
+        //'Messungen'
     ]
 });
--- a/app/controller/Sql.js	Fri Jun 21 16:51:16 2013 +0200
+++ b/app/controller/Sql.js	Fri Jun 21 16:53:39 2013 +0200
@@ -1,13 +1,8 @@
 var queries = new Array('query1', 'query2');
 Ext.define('Lada.controller.Sql', {
     extend: 'Ext.app.Controller',
-    views: [
-        'search.List'
-    ],
     stores: [
-        'Sql',
-        'Uwb',
-        'Mst'
+        'Proben'    // List of found Proben
     ],
     init: function() {
         console.log('Initialising the Sql controller');
--- a/app/store/Mst.js	Fri Jun 21 16:51:16 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-Ext.define('Lada.store.Mst', {
-    extend: 'Ext.data.Store',
-    fields: ['mstId'],
-    proxy: {
-        type: 'ajax',
-        api: {
-        read: 'server/rest/mst'
-        },
-        reader: {
-            type: 'json',
-            root: 'data'
-        }
-    }
-});
--- a/app/store/Sql.js	Fri Jun 21 16:51:16 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-Ext.define('Lada.store.Sql', {
-    extend: 'Ext.data.Store',
-    fields: ['id', 'name', 'description', 'sql'],
-    data  : [
-        {'id': '1', 'name': 'MST, UWB', 'description': 'Beschreibung der MST, UWB Abfrage', 'sql': 'select * from xxx'},
-        {'id': '2', 'name': 'Rbegin', 'description': 'Beschreibung der Rbegin Abfrage', 'sql': 'select * from xxx'}
-    ]
-});
--- a/app/store/Uwb.js	Fri Jun 21 16:51:16 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-Ext.define('Lada.store.Uwb', {
-    extend: 'Ext.data.Store',
-    fields: ['umwId'],
-    proxy: {
-        type: 'ajax',
-        api: {
-        read: 'server/rest/uwb'
-        },
-        reader: {
-            type: 'json',
-            root: 'data'
-        }
-    }
-});
--- a/app/view/Viewport.js	Fri Jun 21 16:51:16 2013 +0200
+++ b/app/view/Viewport.js	Fri Jun 21 16:53:39 2013 +0200
@@ -4,8 +4,7 @@
         'Lada.view.search.List',
         'Lada.view.search.Query1',
         'Lada.view.search.Query2',
-        'Lada.view.proben.List',
-        'Lada.view.proben.Edit'
+        'Lada.view.proben.List'
     ],
     initComponent: function() {
         console.log('Setting up Viewport');
@@ -31,6 +30,7 @@
                     hidden: true
 
                 },
+                // Buttons to trigger the search.
                 {
                     id: 'SearchBtnPanel',
                     xtype: 'panel',
@@ -52,7 +52,6 @@
                     hidden: true
 
                 },
-                // Buttons to trigger the search.
                 // Resultlist for the query.
                 {
                     id: 'result',
--- a/app/view/search/List.js	Fri Jun 21 16:51:16 2013 +0200
+++ b/app/view/search/List.js	Fri Jun 21 16:53:39 2013 +0200
@@ -1,3 +1,11 @@
+var searchStore = Ext.create('Ext.data.Store', {
+    fields: ['id', 'name', 'description', 'sql'],
+    data  : [
+        {'id': '1', 'name': 'MST, UWB', 'description': 'Beschreibung der MST, UWB Abfrage', 'sql': 'select * from xxx'},
+        {'id': '2', 'name': 'Rbegin', 'description': 'Beschreibung der Rbegin Abfrage', 'sql': 'select * from xxx'}
+    ]
+});
+
 Ext.define('Lada.view.search.List' ,{
     extend: 'Ext.form.FieldSet',
     title: 'SQL-Auswahl',
@@ -9,7 +17,7 @@
                 id: 'search',
                 xtype: 'combobox',
                 editable: false,
-                store: 'Sql',
+                store: searchStore,
                 displayField:'name',
                 valueField:'id',
                 emptyText:'Wählen Sie eine Abfrage'
--- a/app/view/widgets/Mst.js	Fri Jun 21 16:51:16 2013 +0200
+++ b/app/view/widgets/Mst.js	Fri Jun 21 16:53:39 2013 +0200
@@ -1,8 +1,22 @@
 // Combobox for Messtelle
+var mstStore = Ext.create('Ext.data.Store', {
+    fields: ['mstId'],
+    proxy: {
+        type: 'ajax',
+        api: {
+        read: 'server/rest/mst'
+        },
+        reader: {
+            type: 'json',
+            root: 'data'
+        }
+    }
+});
+
 Ext.define('Lada.view.widgets.Mst' ,{
         extend: 'Ext.form.ComboBox',
         alias: 'widget.mst',
-        store: 'Mst',
+        store: mstStore,
         displayField:'mstId',
         valueField: 'mstId',
         typeAhead: true,
--- a/app/view/widgets/Uwb.js	Fri Jun 21 16:51:16 2013 +0200
+++ b/app/view/widgets/Uwb.js	Fri Jun 21 16:53:39 2013 +0200
@@ -1,8 +1,22 @@
 // Combobox for Umweltbereich
+var uwbStore = Ext.create('Ext.data.Store', {
+    fields: ['umwId'],
+    proxy: {
+        type: 'ajax',
+        api: {
+        read: 'server/rest/uwb'
+        },
+        reader: {
+            type: 'json',
+            root: 'data'
+        }
+    }
+});
+
 Ext.define('Lada.view.widgets.Uwb' ,{
         extend: 'Ext.form.ComboBox',
         alias: 'widget.uwb',
-        store: 'Uwb',
+        store: uwbStore,
         displayField:'umwId',
         valueField: 'umwId',
         emptyText:'Wählen Sie einen Umweltbereich',

http://lada.wald.intevation.org