From 04823a4ee43f81d84461c29989e7ae135edc2c40 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 15 Oct 2013 15:32:49 +0800 Subject: [PATCH] Pman.Dialog.AdminCoreEnum.bjs Pman.Dialog.AdminCoreEnum.js --- Pman.Dialog.AdminCoreEnum.bjs | 2 +- Pman.Dialog.AdminCoreEnum.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Pman.Dialog.AdminCoreEnum.bjs b/Pman.Dialog.AdminCoreEnum.bjs index ff22788..e1bdd2c 100644 --- a/Pman.Dialog.AdminCoreEnum.bjs +++ b/Pman.Dialog.AdminCoreEnum.bjs @@ -215,7 +215,7 @@ }, { "listeners": { - "click": "function (_self, e)\n{\n var sel = _this.grid.selModel.getSelectedCell();\n if (!sel && _this.callback) {\n Roo.MessageBox.alert(\"Error\", \"Select an item\");\n return;\n }\n var rec = _this.grid.getAt(sel[0]);\n if (_this.callback) {\n _this.callback(rec.data);\n }\n _this.dialog.hide();\n}" + "click": "function (_self, e)\n{\n var sel = _this.grid.selModel.getSelectedCell();\n if (!sel && _this.callback) {\n Roo.MessageBox.alert(\"Error\", \"Select an item\");\n return;\n }\n \n\n if (_this.callback) {\n var rec = _this.grid.getAt(sel[0]);\n _this.callback(rec.data);\n }\n _this.dialog.hide();\n}" }, "*prop": "buttons[]", "text": "OK", diff --git a/Pman.Dialog.AdminCoreEnum.js b/Pman.Dialog.AdminCoreEnum.js index a99bffc..b71be1b 100644 --- a/Pman.Dialog.AdminCoreEnum.js +++ b/Pman.Dialog.AdminCoreEnum.js @@ -347,8 +347,10 @@ Pman.Dialog.AdminCoreEnum = { Roo.MessageBox.alert("Error", "Select an item"); return; } - var rec = _this.grid.getAt(sel[0]); + + if (_this.callback) { + var rec = _this.grid.getAt(sel[0]); _this.callback(rec.data); } _this.dialog.hide(); -- 2.39.2