Pman.Dialog.CoreAutoSavePreview.bjs
[Pman.Core] / Pman.Dialog.CoreAutoSavePreview.js
index c8445e1..6a6c0d2 100644 (file)
@@ -78,7 +78,11 @@ Pman.Dialog.CoreAutoSavePreview = {
                             },
                             rowdblclick : function (_self, rowIndex, e)
                             {
-                            
+                                _this.dialog.hide();
+                                
+                                if (_this.callback) {
+                                    _this.callback.call(this, _this.source);
+                                }
                             }
                         },
                         autoExpandColumn : 'filename',
@@ -103,8 +107,15 @@ Pman.Dialog.CoreAutoSavePreview = {
                                         if(!bSuccess || !res.success){
                                             _this.viewPanel.setContent("Load data failed?!");
                                         }
+                                
+                                        if(typeof(res.data) === 'string'){
+                                            _this.viewPanel.setContent(res.data);
+                                            return;
+                                        }
                                         
-                                        Roo.log(res.data);
+                                        _this.source = res.data.POST.source;
+                                
+                                        _this.viewPanel.setContent(_this.source);
                                         
                                     });
                                 }
@@ -213,7 +224,12 @@ Pman.Dialog.CoreAutoSavePreview = {
                     xns: Roo,
                     listeners : {
                         click : function() {
+                        
                             _this.dialog.hide();
+                            
+                            if (_this.callback) {
+                                _this.callback.call(this, _this.source);
+                            }
                         }
                     },
                     text : "OK"