changeset 153:e9fb4814153a

Added files for Staat, Ort and Verwaltungseinheiten.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 02 Jul 2013 14:08:18 +0200
parents 30aae7295cd0
children 16ba7e2465fd
files app/model/Ortdetail.js app/model/Staat.js app/store/Ortedetails.js app/store/Staaten.js app/store/Verwaltungseinheiten.js app/view/widgets/Ortdetail.js app/view/widgets/Staat.js app/view/widgets/Verwaltungseinheit.js
diffstat 8 files changed, 134 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/model/Ortdetail.js	Tue Jul 02 14:08:18 2013 +0200
@@ -0,0 +1,37 @@
+Ext.define('Lada.model.Ortdetail', {
+    extend: 'Ext.data.Model',
+    fields: [
+        {name: "ortId"},
+        {name: "bezeichnung"},
+        {name: "beschreibung"},
+        {name: "usnscharf"},
+        {name: "nutsCode"},
+        {name: "koordXExtern"},
+        {name: "koordYExtern"},
+        {name: "hoeheLand"},
+        {name: "letzteAenderung", type: 'date', convert: ts2date, defaultValue: new Date()},
+        {name: "longitude", type: 'float'},
+        {name: "latitude", type: 'float'},
+        {name: "staatId"},
+        {name: "gemId"},
+        {name: "oTyp"}
+    ],
+    idProperty: "ortId",
+    proxy: {
+        type: 'rest',
+        appendId: true, //default
+        url: 'server/rest/ortinfo',
+        api: {
+        },
+        reader: {
+            type: 'json',
+            root: 'data'
+        }
+    }
+});
+
+function ts2date(v, record){
+    // Converts a timestamp into a date object.
+    return new Date(v);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/model/Staat.js	Tue Jul 02 14:08:18 2013 +0200
@@ -0,0 +1,26 @@
+Ext.define('Lada.model.Staat', {
+    extend: 'Ext.data.Model',
+    fields: [
+        {name: "staatId", type: 'int'},
+        {name: "staat"},
+        {name: "staatIso"},
+        {name: "staatKurz"}
+    ],
+    idProperty: "staatId",
+    proxy: {
+        type: 'rest',
+        appendId: true, //default
+        url: 'server/rest/staat',
+        api: {
+        },
+        reader: {
+            type: 'json',
+            root: 'data'
+        }
+    }
+});
+
+function ts2date(v, record){
+    // Converts a timestamp into a date object.
+    return new Date(v);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/store/Ortedetails.js	Tue Jul 02 14:08:18 2013 +0200
@@ -0,0 +1,5 @@
+Ext.define('Lada.store.Ortedetails', {
+    extend: 'Ext.data.Store',
+    model: 'Lada.model.Ortdetail',
+    autoLoad: true
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/store/Staaten.js	Tue Jul 02 14:08:18 2013 +0200
@@ -0,0 +1,15 @@
+Ext.define('Lada.store.Staaten', {
+    extend: 'Ext.data.Store',
+    model: 'Lada.model.Staat',
+    autoLoad: true,
+    proxy: {
+        type: 'ajax',
+        api: {
+        read: 'server/rest/staat'
+        },
+        reader: {
+            type: 'json',
+            root: 'data'
+        }
+    }
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/store/Verwaltungseinheiten.js	Tue Jul 02 14:08:18 2013 +0200
@@ -0,0 +1,15 @@
+Ext.define('Lada.store.Verwaltungseinheiten', {
+    extend: 'Ext.data.Store',
+    fields: ['gemId', 'bezeichnung'],
+    autoLoad: true,
+    proxy: {
+        type: 'ajax',
+        api: {
+        read: 'server/rest/verwaltungseinheit'
+        },
+        reader: {
+            type: 'json',
+            root: 'data'
+        }
+    }
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/widgets/Ortdetail.js	Tue Jul 02 14:08:18 2013 +0200
@@ -0,0 +1,12 @@
+// Combobox for Zusatzwert.
+Ext.define('Lada.view.widgets.Ortdetail' ,{
+        extend: 'Ext.form.ComboBox',
+        alias: 'widget.ortdetail',
+        store: 'Ortedetails',
+        displayField: 'beschreibung',
+        valueField: 'ortId',
+        emptyText:'Wählen Sie einen Ort',
+    initComponent: function() {
+        this.callParent(arguments);
+    }
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/widgets/Staat.js	Tue Jul 02 14:08:18 2013 +0200
@@ -0,0 +1,12 @@
+// Combobox for Umweltbereich
+Ext.define('Lada.view.widgets.Staat' ,{
+        extend: 'Ext.form.ComboBox',
+        alias: 'widget.staat',
+        store: 'Staaten',
+        displayField: 'staat',
+        valueField: 'staatId',
+        emptyText:'Wählen Sie einen Staat',
+    initComponent: function() {
+        this.callParent(arguments);
+    }
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/widgets/Verwaltungseinheit.js	Tue Jul 02 14:08:18 2013 +0200
@@ -0,0 +1,12 @@
+// Combobox for Verwaltungseinheit
+Ext.define('Lada.view.widgets.Verwaltungseinheit' ,{
+        extend: 'Ext.form.ComboBox',
+        alias: 'widget.verwaltungseinheiten',
+        store: 'Verwaltungseinheiten',
+        displayField: 'bezeichnung',
+        valueField: 'gemId',
+        emptyText:'Wählen Sie eine Verwaltungseinheit',
+    initComponent: function() {
+        this.callParent(arguments);
+    }
+});

http://lada.wald.intevation.org