Pman.Dialog.XtupleTransfer.bjs
authorEdward <edward@roojs.com>
Mon, 20 Jan 2014 09:29:25 +0000 (17:29 +0800)
committerEdward <edward@roojs.com>
Mon, 20 Jan 2014 09:29:25 +0000 (17:29 +0800)
Pman.Dialog.XtupleTransfer.js

Pman.Dialog.XtupleTransfer.bjs
Pman.Dialog.XtupleTransfer.js

index 42bfaf6..a7b30da 100644 (file)
                                 {
                                     "|xns": "Roo",
                                     "xtype": "Toolbar",
-                                    "*prop": "toolbar"
+                                    "*prop": "toolbar",
+                                    "items": [
+                                        {
+                                            "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"
+                                            },
+                                            "cls": "x-btn-text-icon",
+                                            "text": "Edit",
+                                            "xtype": "Button",
+                                            "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
+                                            "|xns": "Roo.Toolbar"
+                                        }
+                                    ]
                                 },
                                 {
                                     "listeners": {
index ab8c134..1953c82 100644 (file)
@@ -1579,7 +1579,31 @@ Pman.Dialog.XtupleTransfer = {
                         loadMask : true,
                         toolbar : {
                             xtype: 'Toolbar',
-                            xns: Roo
+                            xns: Roo,
+                            items : [
+                                {
+                                    xtype: 'Button',
+                                    xns: Roo.Toolbar,
+                                    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');
+                                            }); 
+                                            
+                                        }
+                                    },
+                                    cls : 'x-btn-text-icon',
+                                    text : "Edit",
+                                    icon : Roo.rootURL + 'images/default/tree/leaf.gif'
+                                }
+                            ]
                         },
                         dataSource : {
                             xtype: 'Store',