diff app/controller/MessungenGrid.js @ 585:4251601c6305

Load status, messwerte and kommentare asynchronously.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 11 Mar 2015 13:13:56 +0100
parents 5af82dc8612d
children
line wrap: on
line diff
--- a/app/controller/MessungenGrid.js	Wed Mar 11 13:12:44 2015 +0100
+++ b/app/controller/MessungenGrid.js	Wed Mar 11 13:13:56 2015 +0100
@@ -30,53 +30,36 @@
         });
     },
 
-    selectionChanged: function(grid, record) {
-        if (record) {
-            grid.view.panel.down('button[action=open]').enable();
-        }
-    },
-
-    gridSave: function(editor, context) {
-        context.record.save({
-            success: function() {
-                context.grid.store.reload();
-                context.grid.up('window').initData();
-            },
-            failure: function() {
-                // TODO
-            }
-        });
-    },
-
     open: function(grid, record) {
         //Opens a detailed view of the Messung
         var win = Ext.create('Lada.view.window.MessungEdit', {
-            record: this.record
+            record: record
         });
         win.show();
         win.initData();
-        // todo
-        console.log('opened window');
     },
 
     add: function() {
-        // todo
+        // TODO
         console.log('add');
     },
 
     remove: function(button) {
         var grid = button.up('grid');
         var selection = grid.getView().getSelectionModel().getSelection()[0];
-        Ext.MessageBox.confirm('Messung löschen', 'Sind Sie sicher?', function(btn) {
-            if (btn === 'yes') {
-                selection.destroy({
-                    success: function() {
-                        button.up('window').initData();
-                    },
-                    failure: function() {
-                    }
-                });
-            }
+        Ext.MessageBox.confirm(
+            'Messung löschen',
+            'Sind Sie sicher?',
+            function(btn) {
+                if (btn === 'yes') {
+                    selection.destroy({
+                        success: function() {
+                            button.up('window').initData();
+                        },
+                        failure: function() {
+                        }
+                    });
+                }
         });
     }
 });

http://lada.wald.intevation.org