From 6ceae3712031f445b7cf2c25871bf964440e0789 Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 8 May 2014 17:32:32 +0800 Subject: [PATCH] Pman.Dialog.CoreAutoSavePreview.bjs Pman.Dialog.CoreAutoSavePreview.js --- Pman.Dialog.CoreAutoSavePreview.bjs | 5 ++++- Pman.Dialog.CoreAutoSavePreview.js | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Pman.Dialog.CoreAutoSavePreview.bjs b/Pman.Dialog.CoreAutoSavePreview.bjs index 73f4ef74..148fbed3 100644 --- a/Pman.Dialog.CoreAutoSavePreview.bjs +++ b/Pman.Dialog.CoreAutoSavePreview.bjs @@ -63,9 +63,12 @@ "|xns": "Roo.grid" }, { + "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 o.params.action = 'AUTOSAVE';\n}" + }, "*prop": "dataSource", - "xtype": "Store", "remoteSort": true, + "xtype": "Store", "|sortInfo": "{ field : 'filename', direction: 'ASC' }", "|xns": "Roo.data", "items": [ diff --git a/Pman.Dialog.CoreAutoSavePreview.js b/Pman.Dialog.CoreAutoSavePreview.js index ea012855..21cbad77 100644 --- a/Pman.Dialog.CoreAutoSavePreview.js +++ b/Pman.Dialog.CoreAutoSavePreview.js @@ -96,6 +96,19 @@ Pman.Dialog.CoreAutoSavePreview = { dataSource : { xtype: 'Store', xns: Roo.data, + listeners : { + beforeload : function (_self, o) + { + o.params = o.params || {}; + + if(typeof(_this.data) == 'undefined'){ + this.removeAll(); + return false; + } + + o.params.action = 'AUTOSAVE'; + } + }, remoteSort : true, sortInfo : { field : 'filename', direction: 'ASC' }, proxy : { -- 2.39.2