Pman.Dialog.CoreAutoSavePreview.bjs
[Pman.Core] / Pman.Dialog.CoreAutoSavePreview.js
index 9e72e5e..4a3bae7 100644 (file)
@@ -68,7 +68,7 @@ Pman.Dialog.CoreAutoSavePreview = {
                                 }
                             }
                         },
-                        autoExpandColumn : 'remarks',
+                        autoExpandColumn : 'event_when',
                         loadMask : true,
                         sm : {
                             xtype: 'RowSelectionModel',
@@ -76,14 +76,13 @@ Pman.Dialog.CoreAutoSavePreview = {
                             listeners : {
                                 afterselectionchange : function (_self)
                                 {
-                                    // load detail log in _this.viewPanel;
+                                    
                                     if (!this.getSelected()) {
                                         this.viewPanel.setContent("Nothing Selected");
                                         return;
                                     }
-                                    var id = this.getSelected().data.id;
-                                    _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
                                     
+                                    this.viewPanel.setContent("data");
                                 }
                             },
                             singleSelect : true
@@ -94,52 +93,9 @@ Pman.Dialog.CoreAutoSavePreview = {
                             listeners : {
                                 beforeload : function (_self, o)
                                 {
-                                    if (!Pman.buildCompleted) {
-                                        return false;
-                                    }
-                                   
-                                   
-                                   if (! _this.personSel) {
-                                    return false;
-                                    }
-                                    o.params = o.params || {};
-                                    o.params.person_id = _this.personSel.getValue();
-                                    var act = _this.actionSel.getValue();
-                                    if (act.length) {
-                                        o.params.action = act;
-                                    }
-                                    var tbl = _this.affectSel.getValue();
-                                    if (tbl.length) {
-                                        o.params.on_table = tbl;
-                                    }
-                                    act = _this.dateFrom.getValue();
-                                    if (act.format) {
-                                        o.params['query[from]'] = act.format('Y-m-d');
-                                    }
-                                    act = _this.dateTo.getValue();
-                                    if (act.format) {
-                                        o.params['query[to]'] = act.format('Y-m-d');
-                                    }
-                                 
-                                    
-                                    /*
-                                    act = _this.groupedCombo.getValue();
-                                    o.params['query[grouped]'] = act;
-                                    if (o.params['query[grouped]'] == 'gr') {
-                                    
-                                        if (!tbl.length) {
-                                            Roo.MessageBox.alert("Error", "Select a table to group results on");
-                                            return false;
-                                        }
-                                //        o.params['_columns']  = 
-                                        o.params['_distinct'] = 'on_id';
-                                        
-                                        
-                                    }
-                                    
-                                    */
-                                
-                                    
+                                    Roo.log(_this.data);
+                                    o.params = o.parmas || {};
+                                    o.action = 'AUTOSAVE'
                                 }
                             },
                             remoteSort : true,
@@ -272,10 +228,10 @@ Pman.Dialog.CoreAutoSavePreview = {
                         footer : {
                             xtype: 'PagingToolbar',
                             xns: Roo,
-                            pageSize : 25,
                             displayInfo : true,
-                            displayMsg : "Displaying Events  {0} - {1} of {2}",
-                            emptyMsg : "No Events found"
+                            displayMsg : "{0} - {1} of {2}",
+                            emptyMsg : "Nothing found",
+                            pageSize : 25
                         },
                         colModel : [
                             {
@@ -285,31 +241,32 @@ Pman.Dialog.CoreAutoSavePreview = {
                                 header : 'Date',
                                 width : 100,
                                 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }
-                            },
-                            {
-                                xtype: 'ColumnModel',
-                                xns: Roo.grid,
-                                dataIndex : 'on_table',
-                                header : 'Affected',
-                                width : 100,
-                                renderer : function(v) {                     
-                                    return String.format('{0})', v ? v : '');  
-                                }
                             }
                         ]
                     }
+                },
+                {
+                    xtype: 'ContentPanel',
+                    xns: Roo,
+                    listeners : {
+                        render : function (_self)
+                        {
+                            _this.viewPanel = _self;
+                        }
+                    },
+                    background : false,
+                    fitContainer : true
                 }
             ],
             center : {
                 xtype: 'LayoutRegion',
-                xns: Roo,
-                titlebar : false
+                xns: Roo
             },
             west : {
                 xtype: 'LayoutRegion',
                 xns: Roo,
                 split : true,
-                width : 300
+                width : 200
             },
             buttons : [
                 {