[Lada-commits] [PATCH 04 of 56] Remeoved methods which are defined in the base class

Wald Commits scm-commit at wald.intevation.org
Tue Aug 13 09:53:30 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1376053138 -7200
# Node ID ea60be45fd4dbcab33aa02d66013fa5705717e5f
# Parent  12e7f0ef90b6d3a14c33248c5c02e28c96364601
Remeoved methods which are defined in the base class.

diff -r 12e7f0ef90b6 -r ea60be45fd4d app/controller/Kommentare.js
--- a/app/controller/Kommentare.js	Fri Aug 09 14:58:13 2013 +0200
+++ b/app/controller/Kommentare.js	Fri Aug 09 14:58:58 2013 +0200
@@ -12,6 +12,10 @@
     models: [
         'Kommentar'
     ],
+    init: function() {
+        console.log('Initialising the Kommentare controller');
+        this.callParent();
+    },
     addListeners: function() {
         this.control({
             'kommentarelist': {
@@ -32,11 +36,6 @@
             }
         });
     },
-    saveItem: function(button) {
-        console.log('Saving Kommentar');
-        var form = button.up('window').down('form');
-        form.commit();
-    },
     addItem: function(button) {
         console.log('Adding new Kommentar for Probe ' + button.probeId);
         var kommentar = Ext.create('Lada.model.Kommentar');
@@ -48,38 +47,10 @@
         var view = Ext.widget('kommentarecreate', {model: record});
         console.log("Loaded Kommentar with ID " + record.getId()); //outputs ID
     },
-    deleteItem: function(button) {
-        var grid = button.up('grid');
-        var selection = grid.getView().getSelectionModel().getSelection()[0];
-        Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){
-            if(btn === 'yes'){
-                var store = grid.getStore();
-                var deleteUrl = selection.getProxy().url + selection.getEidi();
-                Ext.Ajax.request({
-                    url: deleteUrl,
-                    method: 'DELETE',
-                    success: function(response, opts) {
-                        store.reload();
-                    }
-                });
-                console.log('Deleting Kommentar');
-            } else {
-                console.log('Cancel Deleting Kommentar');
-            }
-        });
-    },
     createSuccess: function(form, record, operation) {
         var store = this.getKommentareStore();
         store.reload();
         var win = form.up('window');
         win.close();
-    },
-    createFailure: function(form, record, operation) {
-        Ext.MessageBox.show({
-            title: 'Fehler beim Speichern',
-            msg: form.message,
-            icon: Ext.MessageBox.ERROR,
-            buttons: Ext.Msg.OK
-        });
     }
 });


More information about the Lada-commits mailing list