From: Edward Date: Thu, 8 May 2014 11:12:38 +0000 (+0800) Subject: Pman.Dialog.CoreAutoSavePreview.bjs X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=cec426059135d67757c0aa57b6256cd763c01c2b Pman.Dialog.CoreAutoSavePreview.bjs Pman.Dialog.CoreAutoSavePreview.js --- diff --git a/Pman.Dialog.CoreAutoSavePreview.bjs b/Pman.Dialog.CoreAutoSavePreview.bjs index 27090407..38934451 100644 --- a/Pman.Dialog.CoreAutoSavePreview.bjs +++ b/Pman.Dialog.CoreAutoSavePreview.bjs @@ -57,7 +57,7 @@ "items": [ { "listeners": { - "afterselectionchange": "function (_self)\n{\n var selected = this.getSelected();\n \n _this.viewPanel.load( { url : baseURL + \"/Roo/Events\", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){\n \n _this.source = '';\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 if(!_this.data.successFn){\n Roo.MessageBox.alert('Error', 'Please setup the successFn');\n return;\n }\n \n _this.source = _this.data.successFn(res);\n\n _this.viewPanel.setContent(_this.source);\n \n });\n}" + "afterselectionchange": "function (_self)\n{\n var selected = this.getSelected();\n \n if(!selected){\n \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 _this.source = '';\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 if(!_this.data.successFn){\n Roo.MessageBox.alert('Error', 'Please setup the successFn');\n return;\n }\n \n _this.source = _this.data.successFn(res);\n\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 e4ce7fa7..ddcfa417 100644 --- a/Pman.Dialog.CoreAutoSavePreview.js +++ b/Pman.Dialog.CoreAutoSavePreview.js @@ -88,6 +88,10 @@ Pman.Dialog.CoreAutoSavePreview = { { var selected = this.getSelected(); + if(!selected){ + + } + _this.viewPanel.load( { url : baseURL + "/Roo/Events", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){ _this.source = '';