changeset 41:a1be7ccd4d0c

Added datenbasis combobox
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 24 May 2013 16:37:54 +0200
parents f9b6de636ad0
children 5ed477590736
files app/controller/Proben.js app/store/Datenbasis.js app/view/proben/Edit.js app/view/widgets/Datenbasis.js
diffstat 4 files changed, 34 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Proben.js	Fri May 24 16:36:26 2013 +0200
+++ b/app/controller/Proben.js	Fri May 24 16:37:54 2013 +0200
@@ -6,6 +6,7 @@
     ],
     stores: [
         'Proben',
+        'Datenbasis',
         'Probenart'
     ],
     models: [
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/store/Datenbasis.js	Fri May 24 16:37:54 2013 +0200
@@ -0,0 +1,14 @@
+Ext.define('Lada.store.Datenbasis', {
+    extend: 'Ext.data.Store',
+    fields: ['datenbasisId', 'beschreibung', 'datenbasis'],
+    proxy: {
+        type: 'ajax',
+        api: {
+        read: 'server/rest/datenbasis'
+        },
+        reader: {
+            type: 'json'
+        }
+    }
+});
+
--- a/app/view/proben/Edit.js	Fri May 24 16:36:26 2013 +0200
+++ b/app/view/proben/Edit.js	Fri May 24 16:37:54 2013 +0200
@@ -10,6 +10,7 @@
     modal: true,
 
     requires: [
+        'Lada.view.widgets.Datenbasis',
         'Lada.view.widgets.Probenart'
     ],
 
@@ -51,9 +52,11 @@
                                 collapsed: true,
                                 items: [
                                     {
-                                        xtype: 'textfield',
-                                        name: 'x4',
-                                        fieldLabel: 'Datebasis'
+                                        xtype: 'datenbasis',
+                                        id: 'datenbasis',
+                                        editable: false,
+                                        name: 'datenbasisId',
+                                        fieldLabel: 'Datenbasis'
                                     },
                                     {
                                         xtype: 'textfield',
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/widgets/Datenbasis.js	Fri May 24 16:37:54 2013 +0200
@@ -0,0 +1,13 @@
+// Combobox for Datenbasis
+Ext.define('Lada.view.widgets.Datenbasis' ,{
+        extend: 'Ext.form.ComboBox',
+        alias: 'widget.datenbasis',
+        store: 'Datenbasis',
+        displayField:'datenbasis',
+        valueField: 'datenbasisId',
+        emptyText:'Wählen Sie eine Datenbasis',
+    initComponent: function() {
+        this.callParent(arguments);
+    }
+});
+

http://lada.wald.intevation.org