changeset 8:e4fcb4ddd782

Moved stored SQL into its own file.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 29 Apr 2013 16:31:31 +0200
parents 54f95ab2f375
children 12a65c2c5dbf
files app/controller/Sql.js app/store/Sql.js app/view/sql/List.js index.html
diffstat 4 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Sql.js	Mon Apr 29 16:16:00 2013 +0200
+++ b/app/controller/Sql.js	Mon Apr 29 16:31:31 2013 +0200
@@ -3,6 +3,9 @@
     views: [
         'sql.List'
     ],
+    stores: [
+        'Sql'
+    ],
     init: function() {
         console.log('Initialising the Sql controller');
         this.control({
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/store/Sql.js	Mon Apr 29 16:31:31 2013 +0200
@@ -0,0 +1,8 @@
+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/view/sql/List.js	Mon Apr 29 16:16:00 2013 +0200
+++ b/app/view/sql/List.js	Mon Apr 29 16:31:31 2013 +0200
@@ -1,18 +1,10 @@
 Ext.define('Lada.view.sql.List' ,{
     extend: 'Ext.grid.Panel',
     alias: 'widget.sqllist',
-
     title: 'SQL-Auswahl',
+    store: 'Sql',
 
     initComponent: function() {
-        this.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'}
-            ]
-        };
-
         this.columns = [
             {header: 'ID',  dataIndex: 'id',  flex: 1},
             {header: 'Kurzname', dataIndex: 'name', flex: 1},
--- a/index.html	Mon Apr 29 16:16:00 2013 +0200
+++ b/index.html	Mon Apr 29 16:31:31 2013 +0200
@@ -4,7 +4,7 @@
     <title>Lada</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
-    <script type="text/javascript" src="extjs/ext-all-debug.js"></script>
+    <script type="text/javascript" src="extjs/ext-all-dev.js"></script>
     <script type="text/javascript" src="app.js"></script>
 </head>
 <body></body>

http://lada.wald.intevation.org