Pman.Tab.XtupleCurrency.bjs
authorEdward <edward@roojs.com>
Fri, 27 Dec 2013 05:35:58 +0000 (13:35 +0800)
committerEdward <edward@roojs.com>
Fri, 27 Dec 2013 05:35:58 +0000 (13:35 +0800)
Pman.Tab.XtupleCurrency.js

Pman.Tab.XtupleCurrency.bjs
Pman.Tab.XtupleCurrency.js

index cf0ee78..334fe31 100644 (file)
                                                 },
                                                 {
                                                     "listeners": {
-                                                        "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelected();    \n    new Pman.Request({\n        method: 'POST',\n        url: baseURL+ '/Roo/curr_rate',\n        params : {\n            \n        },\n        success : function() {\n            \n        }\n    });\n}\n"
+                                                        "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelected();\n    \n    if(!s){\n        Roo.MessageBox.alert(\"Error\", \"Please select a currency!\");\n        return;\n    }\n        \n    new Pman.Request({\n        method: 'POST',\n        url: baseURL+ '/Roo/curr_rate',\n        params : {\n            \n        },\n        success : function() {\n            \n        }\n    });\n}\n"
                                                     },
                                                     "cls": "x-btn-text-icon",
                                                     "text": "Get this months rates",
index 3703382..cdb4df9 100644 (file)
@@ -151,7 +151,13 @@ Pman.Tab.XtupleCurrency = new Roo.XComponent({
                                         listeners : {
                                             click : function()
                                             {
-                                                var s = _this.grid.getSelectionModel().getSelected();    
+                                                var s = _this.grid.getSelectionModel().getSelected();
+                                                
+                                                if(!s){
+                                                    Roo.MessageBox.alert("Error", "Please select a currency!");
+                                                    return;
+                                                }
+                                                    
                                                 new Pman.Request({
                                                     method: 'POST',
                                                     url: baseURL+ '/Roo/curr_rate',