Pman.Tab.XtupleCurrency.bjs
[Pman.Xtuple] / Pman.Tab.XtupleCurrency.bjs
1 {
2     "id": "roo-file-529",
3     "name": "Pman.Tab.XtupleCurrency",
4     "parent": "Pman.Tab.XtupleAccountsTab",
5     "title": "Pman.Tab.XtupleCurrency",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleCurrency.bjs",
7     "items": [
8         {
9             "region": "center",
10             "title": "Currency / Rates",
11             "xtype": "NestedLayoutPanel",
12             "|xns": "Roo",
13             "items": [
14                 {
15                     "|xns": "Roo",
16                     "xtype": "BorderLayout",
17                     "*prop": "layout",
18                     "items": [
19                         {
20                             "*prop": "west",
21                             "split": true,
22                             "width": 300,
23                             "xtype": "LayoutRegion",
24                             "|xns": "Roo"
25                         },
26                         {
27                             "|xns": "Roo",
28                             "xtype": "LayoutRegion",
29                             "*prop": "center"
30                         },
31                         {
32                             "listeners": {
33                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
34                             },
35                             "background": false,
36                             "fitContainer": true,
37                             "fitToframe": true,
38                             "region": "west",
39                             "tableName": "curr_symbol",
40                             "title": "curr_symbol",
41                             "xtype": "GridPanel",
42                             "|xns": "Roo",
43                             "items": [
44                                 {
45                                     "*prop": "grid",
46                                     "xtype": "Grid",
47                                     "autoExpandColumn": "curr_name",
48                                     "loadMask": true,
49                                     "listeners": {
50                                         "|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}",
51                                         "|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"
52                                     },
53                                     "|xns": "Roo.grid",
54                                     "items": [
55                                         {
56                                             "*prop": "dataSource",
57                                             "xtype": "Store",
58                                             "remoteSort": true,
59                                             "|sortInfo": "{ field : 'curr_name', direction: 'ASC' }",
60                                             "|xns": "Roo.data",
61                                             "items": [
62                                                 {
63                                                     "*prop": "proxy",
64                                                     "xtype": "HttpProxy",
65                                                     "method": "GET",
66                                                     "|url": "baseURL + '/Roo/curr_symbol.php'",
67                                                     "|xns": "Roo.data"
68                                                 },
69                                                 {
70                                                     "|xns": "Roo.data",
71                                                     "xtype": "JsonReader",
72                                                     "totalProperty": "total",
73                                                     "root": "data",
74                                                     "*prop": "reader",
75                                                     "id": "id",
76                                                     "|fields": "[\n    {\n        'name': 'curr_id',\n        'type': 'int'\n    },\n    {\n        'name': 'curr_base',\n        'type': 'int'\n    },\n    {\n        'name': 'curr_name',\n        'type': 'string'\n    },\n    {\n        'name': 'curr_symbol',\n        'type': 'string'\n    },\n    {\n        'name': 'curr_abbr',\n        'type': 'string'\n    }\n]"
77                                                 }
78                                             ]
79                                         },
80                                         {
81                                             "*prop": "footer",
82                                             "xtype": "PagingToolbar",
83                                             "pageSize": 25,
84                                             "displayInfo": true,
85                                             "displayMsg": "Displaying curr_symbol{0} - {1} of {2}",
86                                             "emptyMsg": "No curr_symbol found",
87                                             "|xns": "Roo"
88                                         },
89                                         {
90                                             "*prop": "toolbar",
91                                             "xtype": "Toolbar",
92                                             "|xns": "Roo",
93                                             "items": [
94                                                 {
95                                                     "|xns": "Roo.Toolbar",
96                                                     "xtype": "Fill"
97                                                 },
98                                                 {
99                                                     "text": "Add",
100                                                     "xtype": "Button",
101                                                     "cls": "x-btn-text-icon",
102                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
103                                                     "listeners": {
104                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
105                                                     },
106                                                     "|xns": "Roo.Toolbar"
107                                                 }
108                                             ]
109                                         },
110                                         {
111                                             "*prop": "colModel[]",
112                                             "dataIndex": "curr_name",
113                                             "header": "Name",
114                                             "width": 80,
115                                             "xtype": "ColumnModel",
116                                             "|renderer": "function(v,x,r) { \n\n    return String.format(r.data.curr_base*1 ? '<span style=\"color:red\">{0}</span>' : '{0}', v); \n    \n}",
117                                             "|xns": "Roo.grid"
118                                         },
119                                         {
120                                             "*prop": "colModel[]",
121                                             "dataIndex": "curr_symbol",
122                                             "header": "Symbol",
123                                             "width": 80,
124                                             "xtype": "ColumnModel",
125                                             "|renderer": "function(v,x,r) { \n\n    return String.format(r.data.curr_base*1 ? '<span style=\"color:red\">{0}</span>' : '{0}', v); \n    \n}",
126                                             "|xns": "Roo.grid"
127                                         },
128                                         {
129                                             "*prop": "colModel[]",
130                                             "dataIndex": "curr_abbr",
131                                             "header": "Abbr.",
132                                             "width": 80,
133                                             "xtype": "ColumnModel",
134                                             "|renderer": "function(v,x,r) { \n\n    return String.format(r.data.curr_base*1 ? '<span style=\"color:red\">{0}</span>' : '{0}', v); \n    \n}",
135                                             "|xns": "Roo.grid"
136                                         }
137                                     ]
138                                 }
139                             ]
140                         },
141                         {
142                             "listeners": {
143                                 "|activate": "function() {\n    _this.rpanel = this;\n    if (_this.rgrid) {\n        _this.rgrid.footer.onClick('first');\n    }\n}"
144                             },
145                             "background": false,
146                             "fitContainer": true,
147                             "fitToframe": true,
148                             "region": "center",
149                             "tableName": "curr_rate",
150                             "title": "curr_rate",
151                             "xtype": "GridPanel",
152                             "|xns": "Roo",
153                             "items": [
154                                 {
155                                     "listeners": {
156                                         "|render": "function() \n{\n    _this.rgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.rpanel.active) {\n       this.footer.onClick('first');\n    }\n}",
157                                         "|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"
158                                     },
159                                     "*prop": "grid",
160                                     "autoExpandColumn": "curr_rate",
161                                     "loadMask": true,
162                                     "xtype": "Grid",
163                                     "|xns": "Roo.grid",
164                                     "items": [
165                                         {
166                                             "listeners": {
167                                                 "beforeload": "function (_self, options)\n{\n    var s = _this.grid.selModel.getSelected();\n    if (!s) { \n        this.removeAll();\n        return false;\n    }\n    options.parms.curr_id = s.data.curr_id;\n}"
168                                             },
169                                             "*prop": "dataSource",
170                                             "remoteSort": true,
171                                             "xtype": "Store",
172                                             "|sortInfo": "{ field : '', direction: 'ASC' }",
173                                             "|xns": "Roo.data",
174                                             "items": [
175                                                 {
176                                                     "*prop": "proxy",
177                                                     "xtype": "HttpProxy",
178                                                     "method": "GET",
179                                                     "|url": "baseURL + '/Roo/curr_rate.php'",
180                                                     "|xns": "Roo.data"
181                                                 },
182                                                 {
183                                                     "|xns": "Roo.data",
184                                                     "xtype": "JsonReader",
185                                                     "totalProperty": "total",
186                                                     "root": "data",
187                                                     "*prop": "reader",
188                                                     "id": "id",
189                                                     "|fields": "[\n    {\n        'name': 'curr_rate_id',\n        'type': 'int'\n    },\n    {\n        'name': 'curr_id',\n        'type': 'int'\n    },\n    {\n        'name': 'curr_id',\n        'type': 'int'\n    },\n    {\n        'name': 'curr_rate',\n        'type': 'float'\n    },\n    {\n        'name': 'curr_effective',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'curr_expires',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    }\n]"
190                                                 }
191                                             ]
192                                         },
193                                         {
194                                             "*prop": "footer",
195                                             "xtype": "PagingToolbar",
196                                             "pageSize": 25,
197                                             "displayInfo": true,
198                                             "displayMsg": "Displaying curr_rate{0} - {1} of {2}",
199                                             "emptyMsg": "No curr_rate found",
200                                             "|xns": "Roo"
201                                         },
202                                         {
203                                             "*prop": "toolbar",
204                                             "xtype": "Toolbar",
205                                             "|xns": "Roo",
206                                             "items": [
207                                                 {
208                                                     "|xns": "Roo.Toolbar",
209                                                     "xtype": "Fill"
210                                                 },
211                                                 {
212                                                     "text": "Add",
213                                                     "xtype": "Button",
214                                                     "cls": "x-btn-text-icon",
215                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
216                                                     "listeners": {
217                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
218                                                     },
219                                                     "|xns": "Roo.Toolbar"
220                                                 }
221                                             ]
222                                         },
223                                         {
224                                             "*prop": "colModel[]",
225                                             "dataIndex": "curr_effective",
226                                             "header": "From",
227                                             "width": 150,
228                                             "xtype": "ColumnModel",
229                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
230                                             "|xns": "Roo.grid"
231                                         },
232                                         {
233                                             "*prop": "colModel[]",
234                                             "dataIndex": "curr_expires",
235                                             "header": "To",
236                                             "width": 150,
237                                             "xtype": "ColumnModel",
238                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
239                                             "|xns": "Roo.grid"
240                                         },
241                                         {
242                                             "*prop": "colModel[]",
243                                             "align": "right",
244                                             "dataIndex": "curr_rate",
245                                             "header": "Rate",
246                                             "width": 75,
247                                             "xtype": "ColumnModel",
248                                             "|renderer": "function(v) { return String.format('{0}', v); }",
249                                             "|xns": "Roo.grid"
250                                         }
251                                     ]
252                                 }
253                             ]
254                         }
255                     ]
256                 }
257             ]
258         }
259     ],
260     "permname": "",
261     "modOrder": "901"
262 }