From 7f6a5532a453152489b8106ccb0d8add3b0d813c Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 8 May 2014 18:26:13 +0800 Subject: [PATCH] Pman.Dialog.CoreAutoSavePreview.bjs Pman.Dialog.CoreAutoSavePreview.js --- Pman.Dialog.CoreAutoSavePreview.bjs | 2 +- Pman.Dialog.CoreAutoSavePreview.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Pman.Dialog.CoreAutoSavePreview.bjs b/Pman.Dialog.CoreAutoSavePreview.bjs index bb954a3c..5c3e84d7 100644 --- a/Pman.Dialog.CoreAutoSavePreview.bjs +++ b/Pman.Dialog.CoreAutoSavePreview.bjs @@ -58,7 +58,7 @@ "items": [ { "listeners": { - "afterselectionchange": "function (_self)\n{\n var selected = this.getSelected();\n \n if (!selected) {\n _this.viewPanel.setContent(\"Nothing Selected\");\n return;\n }\n \n _this.viewPanel.load( { url : baseURL + \"/Roo/Events\", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){\n \n var res = Roo.decode(oResponse.responseText);\n \n if(!bSuccess || !res.success){\n _this.viewPanel.setContent(\"Load data failed?!\");\n }\n \n Roo.log(res.data);\n \n });\n}" + "afterselectionchange": "function (_self)\n{\n var selected = this.getSelected();\n \n if (!selected) {\n _this.viewPanel.setContent(\"Nothing Selected\");\n return;\n }\n \n _this.viewPanel.load( { url : baseURL + \"/Roo/Events\", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){\n \n var res = Roo.decode(oResponse.responseText);\n \n if(!bSuccess || !res.success){\n _this.viewPanel.setContent(\"Load data failed?!\");\n }\n\n if(typeof(res.data) !== 'string'){\n _this.viewPanel.setContent(res.data);\n return;\n }\n \n _this.source = res.data.POST.source;\n _this.viewPanel.setContent(_this.source);\n \n });\n}" }, "*prop": "sm", "singleSelect": true, diff --git a/Pman.Dialog.CoreAutoSavePreview.js b/Pman.Dialog.CoreAutoSavePreview.js index c8445e17..c7c08a21 100644 --- a/Pman.Dialog.CoreAutoSavePreview.js +++ b/Pman.Dialog.CoreAutoSavePreview.js @@ -103,8 +103,14 @@ 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); }); } -- 2.39.2