Pman.Dialog.CoreAutoSavePreview.bjs
[Pman.Core] / Pman.Dialog.CoreAutoSavePreview.js
index 51dcd6a..0257c62 100644 (file)
@@ -75,13 +75,9 @@ Pman.Dialog.CoreAutoSavePreview = {
                                 if (_this.panel.active) {
                                    this.footer.onClick('first');
                                 }
-                            },
-                            rowdblclick : function (_self, rowIndex, e)
-                            {
-                            
                             }
                         },
-                        autoExpandColumn : 'filename',
+                        autoExpandColumn : 'event_when',
                         loadMask : true,
                         sm : {
                             xtype: 'RowSelectionModel',
@@ -95,8 +91,18 @@ Pman.Dialog.CoreAutoSavePreview = {
                                         _this.viewPanel.setContent("Nothing Selected");
                                         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(oElement, bSuccess, oResponse){
+                                        
+                                        var res = Roo.decode(oResponse.responseText);
+                                        
+                                        if(!bSuccess || !res.success){
+                                            _this.viewPanel.setContent("Load data failed?!");
+                                        }
+                                
+                                        _this.data.successFn();
+                                        
+                                    });
                                 }
                             },
                             singleSelect : true
@@ -118,12 +124,12 @@ Pman.Dialog.CoreAutoSavePreview = {
                                 }
                             },
                             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',
@@ -170,6 +176,7 @@ Pman.Dialog.CoreAutoSavePreview = {
                             _this.viewPanel = _self;
                         }
                     },
+                    autoScroll : true,
                     background : false,
                     fitContainer : true,
                     fitToFrame : true,
@@ -202,7 +209,12 @@ Pman.Dialog.CoreAutoSavePreview = {
                     xns: Roo,
                     listeners : {
                         click : function() {
+                        
                             _this.dialog.hide();
+                            
+                            if (_this.callback) {
+                                _this.callback.call(this, _this.source);
+                            }
                         }
                     },
                     text : "OK"