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             "background": false,
10             "closable": false,
11             "collapsible": false,
12             "height": 500,
13             "modal": true,
14             "resizable": false,
15             "title": "Saved Version",
16             "width": 800,
17             "xtype": "LayoutDialog",
18             "|xns": "Roo",
19             "items": [
20                 {
21                     "*prop": "center",
22                     "xtype": "LayoutRegion",
23                     "|xns": "Roo"
24                 },
25                 {
26                     "*prop": "west",
27                     "split": true,
28                     "width": 200,
29                     "xtype": "LayoutRegion",
30                     "|xns": "Roo"
31                 },
32                 {
33                     "listeners": {
34                         "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n    Roo.log(2);\n        _this.grid.footer.onClick('first');\n    }\n}"
35                     },
36                     "background": false,
37                     "fitContainer": true,
38                     "fitToframe": true,
39                     "region": "west",
40                     "tableName": "Events",
41                     "title": "Events",
42                     "xtype": "GridPanel",
43                     "|xns": "Roo",
44                     "items": [
45                         {
46                             "listeners": {
47                                 "|render": "function() { \n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n    Roo.log('1');\n       this.footer.onClick('first');\n    }\n}"
48                             },
49                             "*prop": "grid",
50                             "autoExpandColumn": "event_when",
51                             "loadMask": true,
52                             "xtype": "Grid",
53                             "|xns": "Roo.grid",
54                             "items": [
55                                 {
56                                     "listeners": {
57                                         "afterselectionchange": "function (_self)\n{\n    \n    if (!this.getSelected()) {\n        _this.viewPanel.setContent(\"Nothing Selected\");\n        return;\n    }\n    \n    _this.viewPanel.setContent(\"data\");\n}"
58                                     },
59                                     "*prop": "sm",
60                                     "singleSelect": true,
61                                     "xtype": "RowSelectionModel",
62                                     "|xns": "Roo.grid"
63                                 },
64                                 {
65                                     "listeners": {
66                                         "|beforeload": "function (_self, o)\n{\n    Roo.log(_this.data);\n    o.params = o.parmas || {};\n    o.params.action = 'AUTOSAVE';\n    \n}"
67                                     },
68                                     "*prop": "dataSource",
69                                     "remoteSort": true,
70                                     "xtype": "Store",
71                                     "|sortInfo": "{ field: 'event_when', direction: 'DESC'}",
72                                     "|xns": "Roo.data",
73                                     "items": [
74                                         {
75                                             "|xns": "Roo.data",
76                                             "xtype": "JsonReader",
77                                             "totalProperty": "total",
78                                             "root": "data",
79                                             "*prop": "reader",
80                                             "id": "id",
81                                             "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_name',\n        'type': 'string'\n    },\n    {\n        'name': 'event_when',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'action',\n        'type': 'string'\n    },\n    {\n        'name': 'ipaddr',\n        'type': 'string'\n    },\n    {\n        'name': 'on_id',\n        'type': 'int'\n    },\n    {\n        'name': 'on_table',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_dt',\n        'type': 'date'\n    }\n]"
82                                         },
83                                         {
84                                             "*prop": "proxy",
85                                             "xtype": "HttpProxy",
86                                             "method": "GET",
87                                             "|url": "baseURL + '/Roo/Events.php'",
88                                             "listeners": {},
89                                             "|xns": "Roo.data"
90                                         }
91                                     ]
92                                 },
93                                 {
94                                     "*prop": "footer",
95                                     "pageSize": 25,
96                                     "xtype": "PagingToolbar",
97                                     "|xns": "Roo"
98                                 },
99                                 {
100                                     "*prop": "colModel[]",
101                                     "dataIndex": "event_when",
102                                     "header": "Date",
103                                     "width": 100,
104                                     "xtype": "ColumnModel",
105                                     "|renderer": "function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }",
106                                     "|xns": "Roo.grid"
107                                 }
108                             ]
109                         }
110                     ]
111                 },
112                 {
113                     "listeners": {
114                         "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
115                     },
116                     "background": true,
117                     "fitContainer": true,
118                     "fitToframe": true,
119                     "region": "west",
120                     "tableName": "Images",
121                     "title": "Images",
122                     "xtype": "GridPanel",
123                     "|xns": "Roo",
124                     "items": [
125                         {
126                             "*prop": "grid",
127                             "xtype": "Grid",
128                             "autoExpandColumn": "filename",
129                             "loadMask": true,
130                             "listeners": {
131                                 "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
132                                 "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
133                             },
134                             "|xns": "Roo.grid",
135                             "items": [
136                                 {
137                                     "*prop": "dataSource",
138                                     "xtype": "Store",
139                                     "remoteSort": true,
140                                     "|sortInfo": "{ field : 'filename', direction: 'ASC' }",
141                                     "|xns": "Roo.data",
142                                     "items": [
143                                         {
144                                             "*prop": "proxy",
145                                             "xtype": "HttpProxy",
146                                             "method": "GET",
147                                             "|url": "baseURL + '/Roo/Images.php'",
148                                             "|xns": "Roo.data"
149                                         },
150                                         {
151                                             "|xns": "Roo.data",
152                                             "xtype": "JsonReader",
153                                             "totalProperty": "total",
154                                             "root": "data",
155                                             "*prop": "reader",
156                                             "id": "id",
157                                             "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'filename',\n        'type': 'string'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'width',\n        'type': 'int'\n    },\n    {\n        'name': 'height',\n        'type': 'int'\n    },\n    {\n        'name': 'filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'descript',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_filename',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_onid',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_width',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_height',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_created',\n        'type': 'date'\n    },\n    {\n        'name': 'parent_image_id_imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_descript',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_title',\n        'type': 'string'\n    }\n]"
158                                         }
159                                     ]
160                                 },
161                                 {
162                                     "*prop": "footer",
163                                     "xtype": "PagingToolbar",
164                                     "pageSize": 25,
165                                     "displayInfo": true,
166                                     "displayMsg": "Displaying Images{0} - {1} of {2}",
167                                     "emptyMsg": "No Images found",
168                                     "|xns": "Roo"
169                                 },
170                                 {
171                                     "*prop": "toolbar",
172                                     "xtype": "Toolbar",
173                                     "|xns": "Roo",
174                                     "items": [
175                                         {
176                                             "text": "Add",
177                                             "xtype": "Button",
178                                             "cls": "x-btn-text-icon",
179                                             "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
180                                             "listeners": {
181                                                 "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
182                                             },
183                                             "|xns": "Roo.Toolbar"
184                                         },
185                                         {
186                                             "text": "Edit",
187                                             "xtype": "Button",
188                                             "cls": "x-btn-text-icon",
189                                             "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
190                                             "listeners": {
191                                                 "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
192                                             },
193                                             "|xns": "Roo.Toolbar"
194                                         },
195                                         {
196                                             "text": "Delete",
197                                             "cls": "x-btn-text-icon",
198                                             "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
199                                             "xtype": "Button",
200                                             "listeners": {
201                                                 "|click": "function()\n{\n     Pman.genericDelete(_this, 'Images'); \n}\n        "
202                                             },
203                                             "|xns": "Roo.Toolbar"
204                                         }
205                                     ]
206                                 },
207                                 {
208                                     "xtype": "ColumnModel",
209                                     "header": "Id",
210                                     "width": 75,
211                                     "dataIndex": "id",
212                                     "|renderer": "function(v) { return String.format('{0}', v); }",
213                                     "|xns": "Roo.grid",
214                                     "*prop": "colModel[]"
215                                 },
216                                 {
217                                     "xtype": "ColumnModel",
218                                     "header": "Filename",
219                                     "width": 200,
220                                     "dataIndex": "filename",
221                                     "|renderer": "function(v) { return String.format('{0}', v); }",
222                                     "|xns": "Roo.grid",
223                                     "*prop": "colModel[]"
224                                 },
225                                 {
226                                     "xtype": "ColumnModel",
227                                     "header": "Ontable",
228                                     "width": 200,
229                                     "dataIndex": "ontable",
230                                     "|renderer": "function(v) { return String.format('{0}', v); }",
231                                     "|xns": "Roo.grid",
232                                     "*prop": "colModel[]"
233                                 },
234                                 {
235                                     "xtype": "ColumnModel",
236                                     "header": "Onid",
237                                     "width": 75,
238                                     "dataIndex": "onid",
239                                     "|renderer": "function(v) { return String.format('{0}', v); }",
240                                     "|xns": "Roo.grid",
241                                     "*prop": "colModel[]"
242                                 },
243                                 {
244                                     "xtype": "ColumnModel",
245                                     "header": "Mimetype",
246                                     "width": 200,
247                                     "dataIndex": "mimetype",
248                                     "|renderer": "function(v) { return String.format('{0}', v); }",
249                                     "|xns": "Roo.grid",
250                                     "*prop": "colModel[]"
251                                 },
252                                 {
253                                     "xtype": "ColumnModel",
254                                     "header": "Width",
255                                     "width": 75,
256                                     "dataIndex": "width",
257                                     "|renderer": "function(v) { return String.format('{0}', v); }",
258                                     "|xns": "Roo.grid",
259                                     "*prop": "colModel[]"
260                                 },
261                                 {
262                                     "xtype": "ColumnModel",
263                                     "header": "Height",
264                                     "width": 75,
265                                     "dataIndex": "height",
266                                     "|renderer": "function(v) { return String.format('{0}', v); }",
267                                     "|xns": "Roo.grid",
268                                     "*prop": "colModel[]"
269                                 },
270                                 {
271                                     "xtype": "ColumnModel",
272                                     "header": "Filesize",
273                                     "width": 75,
274                                     "dataIndex": "filesize",
275                                     "|renderer": "function(v) { return String.format('{0}', v); }",
276                                     "|xns": "Roo.grid",
277                                     "*prop": "colModel[]"
278                                 },
279                                 {
280                                     "xtype": "ColumnModel",
281                                     "header": "Displayorder",
282                                     "width": 75,
283                                     "dataIndex": "displayorder",
284                                     "|renderer": "function(v) { return String.format('{0}', v); }",
285                                     "|xns": "Roo.grid",
286                                     "*prop": "colModel[]"
287                                 },
288                                 {
289                                     "xtype": "ColumnModel",
290                                     "header": "Language",
291                                     "width": 200,
292                                     "dataIndex": "language",
293                                     "|renderer": "function(v) { return String.format('{0}', v); }",
294                                     "|xns": "Roo.grid",
295                                     "*prop": "colModel[]"
296                                 },
297                                 {
298                                     "xtype": "ColumnModel",
299                                     "header": "Parent image",
300                                     "width": 75,
301                                     "dataIndex": "parent_image_id",
302                                     "|renderer": "function(v) { return String.format('{0}', v); }",
303                                     "|xns": "Roo.grid",
304                                     "*prop": "colModel[]"
305                                 },
306                                 {
307                                     "xtype": "ColumnModel",
308                                     "header": "Created",
309                                     "width": 75,
310                                     "dataIndex": "created",
311                                     "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
312                                     "|xns": "Roo.grid",
313                                     "*prop": "colModel[]"
314                                 },
315                                 {
316                                     "xtype": "ColumnModel",
317                                     "header": "Imgtype",
318                                     "width": 200,
319                                     "dataIndex": "imgtype",
320                                     "|renderer": "function(v) { return String.format('{0}', v); }",
321                                     "|xns": "Roo.grid",
322                                     "*prop": "colModel[]"
323                                 },
324                                 {
325                                     "xtype": "ColumnModel",
326                                     "header": "Linkurl",
327                                     "width": 200,
328                                     "dataIndex": "linkurl",
329                                     "|renderer": "function(v) { return String.format('{0}', v); }",
330                                     "|xns": "Roo.grid",
331                                     "*prop": "colModel[]"
332                                 },
333                                 {
334                                     "xtype": "ColumnModel",
335                                     "header": "Descript",
336                                     "width": 200,
337                                     "dataIndex": "descript",
338                                     "|renderer": "function(v) { return String.format('{0}', v); }",
339                                     "|xns": "Roo.grid",
340                                     "*prop": "colModel[]"
341                                 },
342                                 {
343                                     "xtype": "ColumnModel",
344                                     "header": "Title",
345                                     "width": 200,
346                                     "dataIndex": "title",
347                                     "|renderer": "function(v) { return String.format('{0}', v); }",
348                                     "|xns": "Roo.grid",
349                                     "*prop": "colModel[]"
350                                 }
351                             ]
352                         }
353                     ]
354                 },
355                 {
356                     "listeners": {
357                         "render": "function (_self)\n{\n    _this.viewPanel = _self;\n}"
358                     },
359                     "background": false,
360                     "fitContainer": true,
361                     "fitToFrame": true,
362                     "region": "center",
363                     "xtype": "ContentPanel",
364                     "|xns": "Roo"
365                 },
366                 {
367                     "listeners": {
368                         "|click": "function() {\n    _this.dialog.hide();\n}"
369                     },
370                     "*prop": "buttons[]",
371                     "text": "Cancel",
372                     "xtype": "Button",
373                     "|xns": "Roo"
374                 },
375                 {
376                     "listeners": {
377                         "|click": "function() {\n    _this.dialog.hide();\n}"
378                     },
379                     "*prop": "buttons[]",
380                     "text": "OK",
381                     "xtype": "Button",
382                     "|xns": "Roo"
383                 }
384             ]
385         }
386     ],
387     "permname": "",
388     "modOrder": "001"
389 }