changeset 644:71e8b84d7829

Reload grids on messung or ort changed/added.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 17 Mar 2015 16:06:33 +0100
parents 477379250512
children 422e71708a0c
files app/controller/form/Messung.js app/controller/form/Ort.js app/controller/grid/Messung.js app/controller/grid/Ort.js app/view/window/MessungCreate.js app/view/window/MessungEdit.js app/view/window/OrtEdit.js
diffstat 7 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/form/Messung.js	Tue Mar 17 16:05:52 2015 +0100
+++ b/app/controller/form/Messung.js	Tue Mar 17 16:06:33 2015 +0100
@@ -39,6 +39,7 @@
                     formPanel.clearMessages();
                     formPanel.setRecord(record);
                     formPanel.setMessages(json.errors, json.warnings);
+                    formPanel.up('window').grid.store.reload();
                     if (response.action === 'create' && json.success) {
                         button.up('window').close();
                         var win = Ext.create('Lada.view.window.MessungEdit', {
--- a/app/controller/form/Ort.js	Tue Mar 17 16:05:52 2015 +0100
+++ b/app/controller/form/Ort.js	Tue Mar 17 16:06:33 2015 +0100
@@ -42,6 +42,7 @@
                     formPanel.clearMessages();
                     formPanel.setRecord(record);
                     formPanel.setMessages(json.errors, json.warnings);
+                    formPanel.up('window').grid.store.reload();
                 }
             },
             failure: function(record, response) {
--- a/app/controller/grid/Messung.js	Tue Mar 17 16:05:52 2015 +0100
+++ b/app/controller/grid/Messung.js	Tue Mar 17 16:06:33 2015 +0100
@@ -32,7 +32,8 @@
 
     editItem: function(grid, record) {
         var win = Ext.create('Lada.view.window.MessungEdit', {
-            record: record
+            record: record,
+            grid: grid
         });
         win.show();
         win.initData();
@@ -41,7 +42,8 @@
     add: function(button) {
         var probe = button.up('window').record;
         var win = Ext.create('Lada.view.window.MessungCreate', {
-            record: probe
+            record: probe,
+            grid: button.up('messunggrid')
         });
         win.show();
         win.initData();
--- a/app/controller/grid/Ort.js	Tue Mar 17 16:05:52 2015 +0100
+++ b/app/controller/grid/Ort.js	Tue Mar 17 16:06:33 2015 +0100
@@ -10,7 +10,8 @@
     extend: 'Ext.app.Controller',
 
     requires: [
-        'Lada.view.window.OrtEdit'
+        'Lada.view.window.OrtEdit',
+        'Lada.view.window.OrtCreate'
     ],
 
     init: function() {
@@ -29,7 +30,8 @@
 
     open: function(grid, record) {
         var win = Ext.create('Lada.view.window.OrtEdit', {
-            record: record
+            record: record,
+            grid: grid
         });
         win.show();
         win.initData();
--- a/app/view/window/MessungCreate.js	Tue Mar 17 16:05:52 2015 +0100
+++ b/app/view/window/MessungCreate.js	Tue Mar 17 16:06:33 2015 +0100
@@ -24,6 +24,7 @@
     layout: 'fit',
 
     record: null,
+    grid: null,
 
     initComponent: function() {
         this.title = 'Messung';
--- a/app/view/window/MessungEdit.js	Tue Mar 17 16:05:52 2015 +0100
+++ b/app/view/window/MessungEdit.js	Tue Mar 17 16:06:33 2015 +0100
@@ -27,6 +27,7 @@
     layout: 'fit',
 
     record: null,
+    grid: null,
 
     initComponent: function() {
         if (this.record === null) {
--- a/app/view/window/OrtEdit.js	Tue Mar 17 16:05:52 2015 +0100
+++ b/app/view/window/OrtEdit.js	Tue Mar 17 16:06:33 2015 +0100
@@ -25,6 +25,7 @@
     layout: 'border',
 
     record: null,
+    grid: null,
 
     initComponent: function() {
         if (this.record === null) {

http://lada.wald.intevation.org