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             "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                                     "*prop": "grid",
47                                     "xtype": "Grid",
48                                     "autoExpandColumn": "curr_name",
49                                     "loadMask": true,
50                                     "listeners": {
51                                         "|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}",
52                                         "|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"
53                                     },
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                                                     "|xns": "Roo.data",
81                                                     "xtype": "JsonReader",
82                                                     "totalProperty": "total",
83                                                     "root": "data",
84                                                     "*prop": "reader",
85                                                     "id": "id",
86                                                     "|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]"
87                                                 }
88                                             ]
89                                         },
90                                         {
91                                             "*prop": "footer",
92                                             "xtype": "PagingToolbar",
93                                             "pageSize": 25,
94                                             "displayInfo": true,
95                                             "displayMsg": "Displaying curr_symbol{0} - {1} of {2}",
96                                             "emptyMsg": "No curr_symbol found",
97                                             "|xns": "Roo"
98                                         },
99                                         {
100                                             "*prop": "toolbar",
101                                             "xtype": "Toolbar",
102                                             "|xns": "Roo",
103                                             "items": [
104                                                 {
105                                                     "|xns": "Roo.Toolbar",
106                                                     "xtype": "Fill"
107                                                 },
108                                                 {
109                                                     "text": "Add",
110                                                     "xtype": "Button",
111                                                     "cls": "x-btn-text-icon",
112                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
113                                                     "listeners": {
114                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
115                                                     },
116                                                     "|xns": "Roo.Toolbar"
117                                                 }
118                                             ]
119                                         },
120                                         {
121                                             "*prop": "colModel[]",
122                                             "dataIndex": "curr_name",
123                                             "header": "Name",
124                                             "width": 80,
125                                             "xtype": "ColumnModel",
126                                             "|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}",
127                                             "|xns": "Roo.grid"
128                                         },
129                                         {
130                                             "*prop": "colModel[]",
131                                             "dataIndex": "curr_symbol",
132                                             "header": "Symbol",
133                                             "width": 80,
134                                             "xtype": "ColumnModel",
135                                             "|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}",
136                                             "|xns": "Roo.grid"
137                                         },
138                                         {
139                                             "*prop": "colModel[]",
140                                             "dataIndex": "curr_abbr",
141                                             "header": "Abbr.",
142                                             "width": 80,
143                                             "xtype": "ColumnModel",
144                                             "|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}",
145                                             "|xns": "Roo.grid"
146                                         }
147                                     ]
148                                 }
149                             ]
150                         },
151                         {
152                             "listeners": {
153                                 "|activate": "function() {\n    _this.rpanel = this;\n    if (_this.rgrid) {\n        _this.rgrid.footer.onClick('first');\n    }\n}"
154                             },
155                             "background": false,
156                             "fitContainer": true,
157                             "fitToframe": true,
158                             "region": "center",
159                             "tableName": "curr_rate",
160                             "title": "curr_rate",
161                             "xtype": "GridPanel",
162                             "|xns": "Roo",
163                             "items": [
164                                 {
165                                     "listeners": {
166                                         "|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}",
167                                         "|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"
168                                     },
169                                     "*prop": "grid",
170                                     "autoExpandColumn": "curr_rate",
171                                     "loadMask": true,
172                                     "xtype": "Grid",
173                                     "|xns": "Roo.grid",
174                                     "items": [
175                                         {
176                                             "listeners": {
177                                                 "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}"
178                                             },
179                                             "*prop": "dataSource",
180                                             "remoteSort": true,
181                                             "xtype": "Store",
182                                             "|sortInfo": "{ field : 'curr_effective', direction: 'DESC' }",
183                                             "|xns": "Roo.data",
184                                             "items": [
185                                                 {
186                                                     "*prop": "proxy",
187                                                     "xtype": "HttpProxy",
188                                                     "method": "GET",
189                                                     "|url": "baseURL + '/Roo/curr_rate.php'",
190                                                     "|xns": "Roo.data"
191                                                 },
192                                                 {
193                                                     "|xns": "Roo.data",
194                                                     "xtype": "JsonReader",
195                                                     "totalProperty": "total",
196                                                     "root": "data",
197                                                     "*prop": "reader",
198                                                     "id": "id",
199                                                     "|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]"
200                                                 }
201                                             ]
202                                         },
203                                         {
204                                             "*prop": "footer",
205                                             "xtype": "PagingToolbar",
206                                             "pageSize": 25,
207                                             "displayInfo": true,
208                                             "displayMsg": "Displaying curr_rate{0} - {1} of {2}",
209                                             "emptyMsg": "No curr_rate found",
210                                             "|xns": "Roo"
211                                         },
212                                         {
213                                             "*prop": "toolbar",
214                                             "xtype": "Toolbar",
215                                             "|xns": "Roo",
216                                             "items": [
217                                                 {
218                                                     "|xns": "Roo.Toolbar",
219                                                     "xtype": "Fill"
220                                                 },
221                                                 {
222                                                     "text": "Add",
223                                                     "xtype": "Button",
224                                                     "cls": "x-btn-text-icon",
225                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
226                                                     "listeners": {
227                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
228                                                     },
229                                                     "|xns": "Roo.Toolbar"
230                                                 }
231                                             ]
232                                         },
233                                         {
234                                             "*prop": "colModel[]",
235                                             "dataIndex": "curr_effective",
236                                             "header": "From",
237                                             "width": 150,
238                                             "xtype": "ColumnModel",
239                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
240                                             "|xns": "Roo.grid"
241                                         },
242                                         {
243                                             "*prop": "colModel[]",
244                                             "dataIndex": "curr_expires",
245                                             "header": "To",
246                                             "width": 150,
247                                             "xtype": "ColumnModel",
248                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
249                                             "|xns": "Roo.grid"
250                                         },
251                                         {
252                                             "*prop": "colModel[]",
253                                             "align": "right",
254                                             "dataIndex": "curr_rate",
255                                             "header": "Rate",
256                                             "width": 75,
257                                             "xtype": "ColumnModel",
258                                             "|renderer": "function(v) { return String.format('{0}', v); }",
259                                             "|xns": "Roo.grid"
260                                         },
261                                         {
262                                             "*prop": "colModel[]",
263                                             "align": "right",
264                                             "dataIndex": "curr_rate",
265                                             "header": "Rate",
266                                             "width": 75,
267                                             "xtype": "ColumnModel",
268                                             "|renderer": "function(v) { return String.format('{0}', v); }",
269                                             "|xns": "Roo.grid"
270                                         },
271                                         {
272                                             "*prop": "colModel[]",
273                                             "align": "right",
274                                             "dataIndex": "curr_rate",
275                                             "header": "Rate",
276                                             "width": 75,
277                                             "xtype": "ColumnModel",
278                                             "|renderer": "function(v) { return String.format('{0}', v); }",
279                                             "|xns": "Roo.grid"
280                                         }
281                                     ]
282                                 }
283                             ]
284                         }
285                     ]
286                 }
287             ]
288         }
289     ],
290     "permname": "",
291     "modOrder": "901"
292 }