Pman.Dialog.CoreAutoSavePreview.bjs
[Pman.Core] / Pman.Dialog.CoreAutoSavePreview.bjs
1 {
2     "id": "roo-file-208",
3     "name": "Pman.Dialog.CoreAutoSavePreview",
4     "parent": "",
5     "title": "",
6     "path": "/home/edward/gitlive/Pman.Core/Pman.Dialog.CoreAutoSavePreview.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "show": "function (_self)\n{\n    if(typeof(_this.data) != 'undefined'){\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
12             "background": false,
13             "closable": false,
14             "collapsible": false,
15             "height": 500,
16             "modal": true,
17             "resizable": false,
18             "title": "Saved Version",
19             "width": 800,
20             "xtype": "LayoutDialog",
21             "|xns": "Roo",
22             "items": [
23                 {
24                     "*prop": "center",
25                     "xtype": "LayoutRegion",
26                     "|xns": "Roo"
27                 },
28                 {
29                     "*prop": "west",
30                     "split": true,
31                     "width": 200,
32                     "xtype": "LayoutRegion",
33                     "|xns": "Roo"
34                 },
35                 {
36                     "listeners": {
37                         "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
38                     },
39                     "background": false,
40                     "fitContainer": true,
41                     "fitToframe": true,
42                     "region": "west",
43                     "tableName": "Images",
44                     "title": "Images",
45                     "xtype": "GridPanel",
46                     "|xns": "Roo",
47                     "items": [
48                         {
49                             "listeners": {
50                                 "|render": "function() \n{\n    _this.grid = this; \n    \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
51                                 "|rowdblclick": "function (_self, rowIndex, e)\n{\n\n}\n"
52                             },
53                             "*prop": "grid",
54                             "autoExpandColumn": "filename",
55                             "loadMask": true,
56                             "xtype": "Grid",
57                             "|xns": "Roo.grid",
58                             "items": [
59                                 {
60                                     "listeners": {
61                                         "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        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        _this.source = res.data.POST.source;\n        _this.viewPanel.setContent(_this.source);\n        \n    });\n}"
62                                     },
63                                     "*prop": "sm",
64                                     "singleSelect": true,
65                                     "xtype": "RowSelectionModel",
66                                     "|xns": "Roo.grid"
67                                 },
68                                 {
69                                     "listeners": {
70                                         "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}"
71                                     },
72                                     "*prop": "dataSource",
73                                     "remoteSort": true,
74                                     "xtype": "Store",
75                                     "|sortInfo": "{ field : 'event_when', direction: 'DESC' }",
76                                     "|xns": "Roo.data",
77                                     "items": [
78                                         {
79                                             "*prop": "proxy",
80                                             "method": "GET",
81                                             "xtype": "HttpProxy",
82                                             "|url": "baseURL + '/Roo/Events.php'",
83                                             "|xns": "Roo.data"
84                                         },
85                                         {
86                                             "*prop": "reader",
87                                             "id": "id",
88                                             "root": "data",
89                                             "totalProperty": "total",
90                                             "xtype": "JsonReader",
91                                             "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'event_when',\n        'type': 'string'\n    }\n]",
92                                             "|xns": "Roo.data"
93                                         }
94                                     ]
95                                 },
96                                 {
97                                     "*prop": "footer",
98                                     "displayInfo": false,
99                                     "pageSize": 25,
100                                     "xtype": "PagingToolbar",
101                                     "|xns": "Roo"
102                                 },
103                                 {
104                                     "*prop": "colModel[]",
105                                     "dataIndex": "event_when",
106                                     "header": "Date",
107                                     "width": 100,
108                                     "xtype": "ColumnModel",
109                                     "|renderer": "function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }",
110                                     "|xns": "Roo.grid"
111                                 }
112                             ]
113                         }
114                     ]
115                 },
116                 {
117                     "listeners": {
118                         "render": "function (_self)\n{\n    _this.viewPanel = _self;\n}"
119                     },
120                     "autoScroll": true,
121                     "background": false,
122                     "fitContainer": true,
123                     "fitToFrame": true,
124                     "region": "center",
125                     "xtype": "ContentPanel",
126                     "|xns": "Roo"
127                 },
128                 {
129                     "listeners": {
130                         "|click": "function() {\n    _this.dialog.hide();\n}"
131                     },
132                     "*prop": "buttons[]",
133                     "text": "Cancel",
134                     "xtype": "Button",
135                     "|xns": "Roo"
136                 },
137                 {
138                     "listeners": {
139                         "|click": "function() {\n    _this.dialog.hide();\n}"
140                     },
141                     "*prop": "buttons[]",
142                     "text": "OK",
143                     "xtype": "Button",
144                     "|xns": "Roo"
145                 }
146             ]
147         }
148     ],
149     "permname": "",
150     "modOrder": "001"
151 }