Pman.Dialog.BuilderProp.bjs
[Pman.Builder] / Pman.Dialog.BuilderProp.bjs
1 {
2     "id": "roo-file-39",
3     "name": "Pman.Dialog.BuilderProp",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/Pman.Builder/Pman.Dialog.BuilderProp.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "show": "function (_self)\n{\n   _this.data.ds.load();\n}"
11             },
12             "closable": false,
13             "collapsible": false,
14             "height": 600,
15             "modal": true,
16             "resizable": false,
17             "title": "Add Property",
18             "width": 600,
19             "xtype": "LayoutDialog",
20             "|xns": "Roo",
21             "items": [
22                 {
23                     "|xns": "Roo",
24                     "xtype": "LayoutRegion",
25                     "*prop": "center"
26                 },
27                 {
28                     "listeners": {
29                         "|activate": "function() {\n    _this.panel = this;\n    //if (_this.grid) {\n    //    _this.grid.ds.load({});\n    //}\n}"
30                     },
31                     "fitContainer": true,
32                     "fitToframe": true,
33                     "region": "center",
34                     "tableName": "AutoAuth",
35                     "title": "AutoAuth",
36                     "xtype": "GridPanel",
37                     "|xns": "Roo",
38                     "items": [
39                         {
40                             "listeners": {
41                                 "|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}",
42                                 "|rowdblclick": "function (_self, rowIndex, e)\n{\n     \n     _this.callback(this.getDataSource().getAt(rowIndex).data.name);\n     _this.dialog.hide(); \n}\n"
43                             },
44                             "*prop": "grid",
45                             "autoExpandColumn": "desc",
46                             "loadMask": true,
47                             "xtype": "Grid",
48                             "|xns": "Roo.grid",
49                             "items": [
50                                 {
51                                     "listeners": {
52                                         "beforeload": "function (_self, options)\n{\n    // we should cache this!!!\n    options.params = options.params || {};\n    options.params.xtype = this.data.xtype;\n    options.params.xns = this.data.xns;\n    options.params.list = this.data.list;    \n}"
53                                     },
54                                     "*prop": "dataSource",
55                                     "remoteSort": false,
56                                     "xtype": "Store",
57                                     "|sortInfo": "{ field : 'name', direction: 'ASC' }",
58                                     "|xns": "Roo.data",
59                                     "items": [
60                                         {
61                                             "*prop": "proxy",
62                                             "method": "GET",
63                                             "xtype": "HttpProxy",
64                                             "|url": "baseURL + '/Builder/Palette/Prop.php'",
65                                             "|xns": "Roo.data"
66                                         },
67                                         {
68                                             "*prop": "reader",
69                                             "id": "id",
70                                             "root": "data",
71                                             "totalProperty": "total",
72                                             "xtype": "JsonReader",
73                                             "|fields": "[\n    'name',\n    'desc'\n]",
74                                             "|xns": "Roo.data"
75                                         }
76                                     ]
77                                 },
78                                 {
79                                     "*prop": "colModel[]",
80                                     "dataIndex": "name",
81                                     "header": "name",
82                                     "width": 175,
83                                     "xtype": "ColumnModel",
84                                     "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
85                                     "|xns": "Roo.grid"
86                                 },
87                                 {
88                                     "*prop": "colModel[]",
89                                     "dataIndex": "desc",
90                                     "header": "Description",
91                                     "width": 200,
92                                     "xtype": "ColumnModel",
93                                     "|renderer": "function(v) { return String.format('{0}', v); }",
94                                     "|xns": "Roo.grid"
95                                 }
96                             ]
97                         }
98                     ]
99                 },
100                 {
101                     "listeners": {
102                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
103                     },
104                     "*prop": "buttons[]",
105                     "text": "Cancel",
106                     "xtype": "Button",
107                     "|xns": "Roo"
108                 },
109                 {
110                     "listeners": {
111                         "click": "function (_self, e)\n{\n    // do some checks?\n     var sel = _this.grid.getSelectionModel().getSelected();\n    if (!sel) {\n        Roo.MessageBox.alert(\"Error\", \"Select a property\");\n    }\n    \n    _this.callback(sel.data.name);\n   _this.dialog.hide();\n \n\n}"
112                     },
113                     "*prop": "buttons[]",
114                     "text": "Add",
115                     "xtype": "Button",
116                     "|xns": "Roo"
117                 }
118             ]
119         }
120     ],
121     "permname": "",
122     "modOrder": "001"
123 }