diff app/controller/Proben.js @ 53:73bc17de6ff2

Added store, view and model for kommentare. Load kommentare when opening a probe.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 28 May 2013 10:58:47 +0200
parents af418743e1f4
children 3c7bfff8bd64
line wrap: on
line diff
--- a/app/controller/Proben.js	Mon May 27 14:59:59 2013 +0200
+++ b/app/controller/Proben.js	Tue May 28 10:58:47 2013 +0200
@@ -10,7 +10,8 @@
         'Datenbasis',
         'Probenart',
         'Betriebsart',
-        'Testdatensatz'
+        'Testdatensatz',
+        'Kommentare'
     ],
     models: [
         'Probe'
@@ -38,13 +39,20 @@
         console.log('Double click on ' + record.get('probeId'));
         // Create new window to edit the seletced record.
         var view = Ext.widget('probenedit');
-        //console.log(Ext.ModelManager.getModel('Lada.model.Probe'));
-        Ext.ModelManager.getModel('Lada.model.Probe').load(record.get('probeId'), {
-            success: function(record) {
-                view.down('form').loadRecord(record);
-                console.log("Loaded probe with ID " + record.getId()); //outputs ID
+        var form = view.down('form');
+        form.loadRecord(record);
+
+        // Load kommentare
+        var kommentare = form.down('kommentarelist'); //form.down('kommentare');
+        var kstore = kommentare.getStore();
+        kstore.load({
+            params: {
+                probe: record.data['probeId']
             }
         });
+
+        // Set form data
+        console.log("Loaded probe with ID " + record.getId()); //outputs ID
     },
     updateProbe: function(button) {
         console.log('Click save');

http://lada.wald.intevation.org