From: Edward Date: Thu, 8 May 2014 11:09:48 +0000 (+0800) Subject: Pman.Dialog.CoreAutoSavePreview.bjs X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=4de95ea420c7655f819f9d155e64a68df8795e76 Pman.Dialog.CoreAutoSavePreview.bjs Pman.Dialog.CoreAutoSavePreview.js --- diff --git a/Pman.Dialog.CoreAutoSavePreview.bjs b/Pman.Dialog.CoreAutoSavePreview.bjs index 14fcf781..12914032 100644 --- a/Pman.Dialog.CoreAutoSavePreview.bjs +++ b/Pman.Dialog.CoreAutoSavePreview.bjs @@ -66,7 +66,8 @@ }, { "listeners": { - "beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n \n if(typeof(_this.data) == 'undefined'){\n this.removeAll();\n return false;\n }\n\n var d = Roo.apply({}, _this.data);\n delete d.successFn;\n\n Roo.apply(o.params, d);\n \n}" + "beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n \n if(typeof(_this.data) == 'undefined'){\n this.removeAll();\n return false;\n }\n\n var d = Roo.apply({}, _this.data);\n delete d.successFn;\n\n Roo.apply(o.params, d);\n \n}", + "load": "function (_self, records, options)\n{\n var sm = _this.grid.getSelectionModel();\n if (!sm.getSelections().length) {\n sm.selectFirstRow();\n }\n}" }, "*prop": "dataSource", "remoteSort": true, diff --git a/Pman.Dialog.CoreAutoSavePreview.js b/Pman.Dialog.CoreAutoSavePreview.js index a34516d7..65114746 100644 --- a/Pman.Dialog.CoreAutoSavePreview.js +++ b/Pman.Dialog.CoreAutoSavePreview.js @@ -135,6 +135,13 @@ Pman.Dialog.CoreAutoSavePreview = { Roo.apply(o.params, d); + }, + load : function (_self, records, options) + { + var sm = _this.grid.getSelectionModel(); + if (!sm.getSelections().length) { + sm.selectFirstRow(); + } } }, remoteSort : true,