Pman.Dialog.CoreAutoSavePreview.bjs
[Pman.Core] / Pman.Dialog.CoreAutoSavePreview.bjs
index 891a5a5..6814f0e 100644 (file)
                     "items": [
                         {
                             "listeners": {
-                                "|render": "function() \n{\n    _this.grid = this; \n    \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
-                                "|rowdblclick": "function (_self, rowIndex, e)\n{\n\n}\n"
+                                "|render": "function() \n{\n    _this.grid = this; \n    \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}"
                             },
                             "*prop": "grid",
-                            "autoExpandColumn": "filename",
+                            "autoExpandColumn": "event_when",
                             "loadMask": true,
                             "xtype": "Grid",
                             "|xns": "Roo.grid",
                             "items": [
                                 {
                                     "listeners": {
-                                        "afterselectionchange": "function (_self)\n{\n    var selected = this.getSelected();\n    \n    if (!selected) {\n        _this.viewPanel.setContent(\"Nothing Selected\");\n        return;\n    }\n    Roo.log(selected);\n    _this.viewPanel.setContent(\"Data Selected\");\n}"
+                                        "afterselectionchange": "function (_self)\n{\n    var selected = this.getSelected();\n    \n    if (!selected) {\n        _this.viewPanel.setContent(\"Nothing Selected\");\n        return;\n    }\n    \n    _this.viewPanel.load( { url : baseURL + \"/Roo/Events\", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){\n        \n        _this.source = '';\n        \n        var res = Roo.decode(oResponse.responseText);\n        \n        if(!bSuccess || !res.success){\n            _this.viewPanel.setContent(\"Load data failed?!\");\n        }\n        \n        if(typeof(res.data) === 'string'){\n            _this.viewPanel.setContent(res.data);\n            return;\n        }\n        \n        if(!_this.data.successFn){\n            Roo.MessageBox.alert('Error', 'Please setup the successFn');\n            return;\n        }\n        \n        _this.source = _this.data.successFn(res);\n\n        _this.viewPanel.setContent(_this.source);\n        \n    });\n}"
                                     },
                                     "*prop": "sm",
                                     "singleSelect": true,
@@ -67,7 +66,7 @@
                                 },
                                 {
                                     "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    Roo.log(_this.data);\n    o.params.action = 'AUTOSAVE';\n}"
+                                        "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    var d = _this.data;\n    delete d.successFn;\n    Roo.apply(o.params, d);\n    \n}"
                                     },
                                     "*prop": "dataSource",
                                     "remoteSort": true,
@@ -77,9 +76,9 @@
                                     "items": [
                                         {
                                             "*prop": "proxy",
-                                            "xtype": "HttpProxy",
                                             "method": "GET",
-                                            "|url": "baseURL + '/Roo/Images.php'",
+                                            "xtype": "HttpProxy",
+                                            "|url": "baseURL + '/Roo/Events.php'",
                                             "|xns": "Roo.data"
                                         },
                                         {
                     "listeners": {
                         "render": "function (_self)\n{\n    _this.viewPanel = _self;\n}"
                     },
+                    "autoScroll": true,
                     "background": false,
                     "fitContainer": true,
                     "fitToFrame": true,
                 },
                 {
                     "listeners": {
-                        "|click": "function() {\n    _this.dialog.hide();\n}"
+                        "|click": "function() {\n\n    _this.dialog.hide();\n    \n    if (_this.callback) {\n        _this.callback.call(this, _this.source);\n    }\n}"
                     },
                     "*prop": "buttons[]",
                     "text": "OK",