Pman.Tab.AdminContacts.bjs
authorChris <chris@roojs.com>
Fri, 8 Mar 2013 06:57:19 +0000 (14:57 +0800)
committerChris <chris@roojs.com>
Fri, 8 Mar 2013 06:57:19 +0000 (14:57 +0800)
Pman.Tab.AdminContacts.js

Pman.Tab.AdminContacts.bjs
Pman.Tab.AdminContacts.js

index 9d9844f..095d9b5 100644 (file)
                                     "|xns": "Roo.Toolbar"
                                 },
                                 {
+                                    "listeners": {
+                                        "click": "function (_self, e)\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if(s.length != 1){\n        Roo.MessageBox.alert(\"Error\", \"Select a Person\");\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Login.php',\n        method : 'GET',\n        params : {\n            'switch' : s[0].data.id\n        },\n        success : function (){\n            document.location = baseURL + '?ts=' + Math.random();\n        },\n        failure : function (d){\n            Roo.log(d);\n            Roo.MessageBox.alert(\"Error\", d);\n        }\n    });\n}"
+                                    },
                                     "text": "Switch to Selected User",
                                     "xtype": "Button",
                                     "|xns": "Roo.Toolbar"
index 8b5e9db..fabe0db 100644 (file)
@@ -640,6 +640,31 @@ Pman.Tab.AdminContacts = new Roo.XComponent({
                         {
                             xtype: 'Button',
                             xns: Roo.Toolbar,
+                            listeners : {
+                                click : function (_self, e)
+                                {
+                                    var s = _this.grid.getSelectionModel().getSelections();
+                                    if(s.length != 1){
+                                        Roo.MessageBox.alert("Error", "Select a Person");
+                                        return;
+                                    }
+                                    
+                                    new Pman.Request({
+                                        url : baseURL + '/Login.php',
+                                        method : 'GET',
+                                        params : {
+                                            'switch' : s[0].data.id
+                                        },
+                                        success : function (){
+                                            document.location = baseURL + '?ts=' + Math.random();
+                                        },
+                                        failure : function (d){
+                                            Roo.log(d);
+                                            Roo.MessageBox.alert("Error", d);
+                                        }
+                                    });
+                                }
+                            },
                             text : "Switch to Selected User"
                         },
                         {