Pman.Dialog.CoreAutoSavePreview.bjs
[Pman.Core] / Pman.Dialog.CoreAutoSavePreview.js
index 21cbad7..ce759d2 100644 (file)
@@ -30,6 +30,14 @@ Pman.Dialog.CoreAutoSavePreview = {
         this.dialog = Roo.factory({
             xtype: 'LayoutDialog',
             xns: Roo,
+            listeners : {
+                show : function (_self)
+                {
+                    if(typeof(_this.data) != 'undefined'){
+                        _this.grid.footer.onClick('first');
+                    }
+                }
+            },
             background : false,
             closable : false,
             collapsible : false,
@@ -88,7 +96,11 @@ Pman.Dialog.CoreAutoSavePreview = {
                                         return;
                                     }
                                     Roo.log(selected);
-                                    _this.viewPanel.setContent("Data Selected");
+                                    _this.viewPanel.load( { url : baseURL + "/Roo/Events", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(res){
+                                        Roo.log('res is here after load');
+                                        Roo.log(res);
+                                    
+                                    });
                                 }
                             },
                             singleSelect : true
@@ -105,17 +117,17 @@ Pman.Dialog.CoreAutoSavePreview = {
                                         this.removeAll();
                                         return false;
                                     }
-                                    
+                                    Roo.log(_this.data);
                                     o.params.action = 'AUTOSAVE';
                                 }
                             },
                             remoteSort : true,
-                            sortInfo : { field : 'filename', direction: 'ASC' },
+                            sortInfo : { field : 'event_when', direction: 'DESC' },
                             proxy : {
                                 xtype: 'HttpProxy',
                                 xns: Roo.data,
                                 method : 'GET',
-                                url : baseURL + '/Roo/Images.php'
+                                url : baseURL + '/Roo/Events.php'
                             },
                             reader : {
                                 xtype: 'JsonReader',
@@ -162,6 +174,7 @@ Pman.Dialog.CoreAutoSavePreview = {
                             _this.viewPanel = _self;
                         }
                     },
+                    autoScroll : true,
                     background : false,
                     fitContainer : true,
                     fitToFrame : true,