diff app/controller/ProbenzusatzwertGrid.js @ 571:1dedce48e3e1

Implemented the 'add' button; fixed renderer and controller.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 10 Mar 2015 12:11:50 +0100
parents 98dee8166459
children 8d2cf853eed2
line wrap: on
line diff
--- a/app/controller/ProbenzusatzwertGrid.js	Tue Mar 10 12:09:50 2015 +0100
+++ b/app/controller/ProbenzusatzwertGrid.js	Tue Mar 10 12:11:50 2015 +0100
@@ -35,8 +35,12 @@
         });
     },
 
-    add: function() {
-        console.log('add');
+    add: function(button) {
+        var record = Ext.create('Lada.model.Zusatzwert', {
+            probeId: button.up('probenzusatzwertgrid').recordId
+        });
+        button.up('probenzusatzwertgrid').store.insert(0, record);
+        button.up('probenzusatzwertgrid').rowEditing.startEdit(0, 1);
     },
 
     remove: function(button) {
@@ -47,8 +51,10 @@
                 selection.destroy({
                     success: function() {
                         button.up('window').initData();
+                        grid.initData();
                     },
                     failure: function() {
+                        // TODO
                     }
                 });
             }

http://lada.wald.intevation.org