Pman.Dialog.AdminEnumImages.bjs
authorbenny <benny@roojs.com>
Thu, 12 Jul 2018 08:28:37 +0000 (16:28 +0800)
committerbenny <benny@roojs.com>
Thu, 12 Jul 2018 08:28:37 +0000 (16:28 +0800)
Pman.Dialog.AdminEnumImages.js

Pman.Dialog.AdminEnumImages.bjs
Pman.Dialog.AdminEnumImages.js

index 61290fe..791478f 100644 (file)
           },
           {
            "listeners" : {
-            "|click" : "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    \n    if (!s || s.length != 1) {\n        Roo.MessageBox.alert(\"Error\", \"Select a single image to edit\");\n       return;\n     }\n     var data = _this.grid.getDataSource().getById(s[0].data.id).data;\n    \n             Pman.Dialog.Image.show(data, function() {\n                _this.grid.footer.onClick('first');\n               });\n            \n        }\n        "
+            "|click" : "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    \n    if (!s || s.length != 1) {\n        Roo.MessageBox.alert(\"Error\", \"Select a single image to edit\");\n       return;\n     }\n     var data = _this.grid.getDataSource().getById(s[0].data.id).data;\n    \n     if (!_this.dialog) {\n        return;\n    }\n    _this.dialog.show(s[0].data, function() {\n         _this.grid.ds.load({});\n    }); \n            \n}\n\n    "
            },
            "text" : "Edit",
            "xtype" : "Button",
index 01d89b5..b646866 100644 (file)
@@ -175,11 +175,14 @@ Pman.Dialog.AdminEnumImages = {
                  }
                  var data = _this.grid.getDataSource().getById(s[0].data.id).data;
                 
-                         Pman.Dialog.Image.show(data, function() {
-                            _this.grid.footer.onClick('first');
-                           });
+                 if (!_this.dialog) {
+                    return;
+                }
+                _this.dialog.show(s[0].data, function() {
+                     _this.grid.ds.load({});
+                }); 
                         
-                    }
+            }
           },
           xns : Roo,
           '|xns' : 'Roo'