[Lada-commits] [PATCH] Added files for Staat, Ort and Verwaltungseinheiten

Wald Commits scm-commit at wald.intevation.org
Tue Jul 2 14:09:12 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1372766898 -7200
# Node ID e9fb4814153a04f1e773ab1618dbdb3c9eb3bc6c
# Parent  30aae7295cd0c60254ca9fc244fe77bb107b21e3
Added files for Staat, Ort and Verwaltungseinheiten.

diff -r 30aae7295cd0 -r e9fb4814153a app/model/Ortdetail.js
--- /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);
+}
+
diff -r 30aae7295cd0 -r e9fb4814153a app/model/Staat.js
--- /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);
+}
diff -r 30aae7295cd0 -r e9fb4814153a app/store/Ortedetails.js
--- /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
+});
diff -r 30aae7295cd0 -r e9fb4814153a app/store/Staaten.js
--- /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'
+        }
+    }
+});
diff -r 30aae7295cd0 -r e9fb4814153a app/store/Verwaltungseinheiten.js
--- /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'
+        }
+    }
+});
diff -r 30aae7295cd0 -r e9fb4814153a app/view/widgets/Ortdetail.js
--- /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);
+    }
+});
diff -r 30aae7295cd0 -r e9fb4814153a app/view/widgets/Staat.js
--- /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);
+    }
+});
diff -r 30aae7295cd0 -r e9fb4814153a app/view/widgets/Verwaltungseinheit.js
--- /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);
+    }
+});


More information about the Lada-commits mailing list