Pman.Tab.AdminWatches.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 28 Sep 2011 07:28:24 +0000 (15:28 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 28 Sep 2011 07:28:24 +0000 (15:28 +0800)
Pman.Tab.AdminWatches.bjs
Pman.Tab.AdminWatches.js
Pman.Tab.AdminWatches.js
Pman.Tab.AdminWatches.bjs
Pman.Tab.AdminWatches.bjs
Pman.Tab.AdminWatches.js
Pman.Tab.AdminWatches.js

Pman.Tab.AdminWatches.bjs
Pman.Tab.AdminWatches.js

index d8df3c2..7b84e11 100644 (file)
                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
                                     },
                                     "|xns": "Roo.Toolbar"
+                                },
+                                {
+                                    "text": "Edit",
+                                    "xtype": "Button",
+                                    "cls": "x-btn-text-icon",
+                                    "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
+                                    "listeners": {
+                                        "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
+                                    },
+                                    "|xns": "Roo.Toolbar"
+                                },
+                                {
+                                    "text": "Delete",
+                                    "cls": "x-btn-text-icon",
+                                    "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
+                                    "xtype": "Button",
+                                    "listeners": {
+                                        "|click": "function()\n{\n     Pman.genericDelete(_this, 'core_watch'); \n}\n        "
+                                    },
+                                    "|xns": "Roo.Toolbar"
                                 }
                             ]
                         },
index fd413f4..80cf225 100644 (file)
@@ -451,6 +451,41 @@ Pman.Tab.AdminWatches = new Roo.util.Observable({
                                    }); 
                                 }
                             }
+                        },
+                        {
+                            xtype: 'Button',
+                            xns: Roo.Toolbar,
+                            text : "Edit",
+                            cls : 'x-btn-text-icon',
+                            icon : Roo.rootURL + 'images/default/tree/leaf.gif',
+                            listeners : {
+                                click : function()
+                                {
+                                    var s = _this.grid.getSelectionModel().getSelections();
+                                    if (!s.length || (s.length > 1))  {
+                                        Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
+                                        return;
+                                    }
+                                    if (!_this.dialog) return;
+                                    _this.dialog.show(s[0].data, function() {
+                                        _this.grid.footer.onClick('first');
+                                    }); 
+                                    
+                                }
+                            }
+                        },
+                        {
+                            xtype: 'Button',
+                            xns: Roo.Toolbar,
+                            text : "Delete",
+                            cls : 'x-btn-text-icon',
+                            icon : rootURL + '/Pman/templates/images/trash.gif',
+                            listeners : {
+                                click : function()
+                                {
+                                     Pman.genericDelete(_this, 'core_watch'); 
+                                }
+                            }
                         }
                     ]
                 },