changeset 13:a8efc4b96888

Added model for Proben and a Store.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 30 Apr 2013 12:34:36 +0200
parents cdcaf38eab45
children c0b2faa47ee5
files app/controller/Proben.js app/model/Probe.js app/store/Proben.js app/view/proben/List.js
diffstat 4 files changed, 20 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Proben.js	Tue Apr 30 10:50:00 2013 +0200
+++ b/app/controller/Proben.js	Tue Apr 30 12:34:36 2013 +0200
@@ -3,6 +3,12 @@
     views: [
         'proben.List'
     ],
+    stores: [
+        'Proben'
+    ],
+    models: [
+        'Probe'
+    ],
     init: function() {
         console.log('Initialising the Proben controller');
         this.control({
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/model/Probe.js	Tue Apr 30 12:34:36 2013 +0200
@@ -0,0 +1,4 @@
+Ext.define('Lada.model.Probe', {
+    extend: 'Ext.data.Model',
+    fields: ['datenbasisId', 'probeId']
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/store/Proben.js	Tue Apr 30 12:34:36 2013 +0200
@@ -0,0 +1,7 @@
+Ext.define('Lada.store.Proben', {
+    extend: 'Ext.data.Store',
+    fields: ['probeId', 'datenbasisId'],
+    model: 'Lada.model.Probe',
+    data  : []
+});
+
--- a/app/view/proben/List.js	Tue Apr 30 10:50:00 2013 +0200
+++ b/app/view/proben/List.js	Tue Apr 30 12:34:36 2013 +0200
@@ -1,23 +1,14 @@
 Ext.define('Lada.view.proben.List' ,{
     extend: 'Ext.grid.Panel',
     alias: 'widget.probenlist',
-
     title: 'Alle Proben',
+    store: 'Proben',
 
     initComponent: function() {
-        this.store = {
-            fields: ['name', 'email'],
-            data  : [
-                {name: 'Ed',    email: 'ed@sencha.com'},
-                {name: 'Tommy', email: 'tommy@sencha.com'}
-            ]
-        };
-
         this.columns = [
-            {header: 'Name',  dataIndex: 'name',  flex: 1},
-            {header: 'Email', dataIndex: 'email', flex: 1}
+            {header: 'Datenbasis',  dataIndex: 'datenbasisId',  flex: 1},
+            {header: 'ProbeID', dataIndex: 'probeId', flex: 1}
         ];
-
         this.callParent(arguments);
     }
 });

http://lada.wald.intevation.org