Pman.Dialog.CoreAutoSavePreview.bjs
authorEdward <edward@roojs.com>
Thu, 8 May 2014 09:32:32 +0000 (17:32 +0800)
committerEdward <edward@roojs.com>
Thu, 8 May 2014 09:32:32 +0000 (17:32 +0800)
Pman.Dialog.CoreAutoSavePreview.js

Pman.Dialog.CoreAutoSavePreview.bjs
Pman.Dialog.CoreAutoSavePreview.js

index 73f4ef7..148fbed 100644 (file)
                                     "|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": [
index ea01285..21cbad7 100644 (file)
@@ -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 : {