Pman.Dialog.CoreNotifyRecur.bjs
authorAlan Knowles <alan@akbkhome.com>
Wed, 16 May 2012 10:38:19 +0000 (18:38 +0800)
committerAlan Knowles <alan@akbkhome.com>
Wed, 16 May 2012 10:38:19 +0000 (18:38 +0800)
Pman.Dialog.CoreNotifyRecur.js

Pman.Dialog.CoreNotifyRecur.bjs
Pman.Dialog.CoreNotifyRecur.js

index 72a063c..3ad8d2c 100644 (file)
                                         },
                                         {
                                             "listeners": {
-                                                "|click": "function()\n{\n     var s = _this.grid.getSelectionModel().getSelected();\n     Roo.log(s);\n}\n        "
+                                                "|click": "function()\n{\n     _this.grid.stopEditing();\n     var s = _this.grid.selModel.getSelectedCell()\n     if (!s) {\n        Roo.MessageBox.alert(\"Error\", \"Select row\");\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/core_notify_recur',\n        method : 'POST',\n        params : {\n            _delete : _this.grid.ds.getAt(s[0]).data.id,\n        }, \n        success : function() {\n            _this.grid.ds.load({});\n        },\n        failure : function() {\n            Roo.MessageBox.alert(\"Error\", \"Deleting failed - try reloading\");\n        }\n   });\n    \n}\n        "
                                             },
                                             "cls": "x-btn-text-icon",
                                             "text": "Delete",
index 22034fa..cd0cc56 100644 (file)
@@ -239,8 +239,27 @@ Pman.Dialog.CoreNotifyRecur = {
                                     listeners : {
                                         click : function()
                                         {
-                                             var s = _this.grid.getSelectionModel().getSelected();
-                                             Roo.log(s);
+                                             _this.grid.stopEditing();
+                                             var s = _this.grid.selModel.getSelectedCell()
+                                             if (!s) {
+                                                Roo.MessageBox.alert("Error", "Select row");
+                                                return;
+                                            }
+                                            
+                                            new Pman.Request({
+                                                url : baseURL + '/Roo/core_notify_recur',
+                                                method : 'POST',
+                                                params : {
+                                                    _delete : _this.grid.ds.getAt(s[0]).data.id,
+                                                }, 
+                                                success : function() {
+                                                    _this.grid.ds.load({});
+                                                },
+                                                failure : function() {
+                                                    Roo.MessageBox.alert("Error", "Deleting failed - try reloading");
+                                                }
+                                           });
+                                            
                                         }
                                     },
                                     cls : 'x-btn-text-icon',