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