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                                             "listeners": {
57                                                 "afterselectionchange": "function (_self)\n{\n    _this.rgrid.footer.onClick('first');\n}"
58                                             },
59                                             "*prop": "sm",
60                                             "singleSelect": true,
61                                             "xtype": "RowSelectionModel",
62                                             "|xns": "Roo.grid"
63                                         },
64                                         {
65                                             "*prop": "dataSource",
66                                             "xtype": "Store",
67                                             "remoteSort": true,
68                                             "|sortInfo": "{ field : 'curr_name', direction: 'ASC' }",
69                                             "|xns": "Roo.data",
70                                             "items": [
71                                                 {
72                                                     "*prop": "proxy",
73                                                     "xtype": "HttpProxy",
74                                                     "method": "GET",
75                                                     "|url": "baseURL + '/Roo/curr_symbol.php'",
76                                                     "|xns": "Roo.data"
77                                                 },
78                                                 {
79                                                     "|xns": "Roo.data",
80                                                     "xtype": "JsonReader",
81                                                     "totalProperty": "total",
82                                                     "root": "data",
83                                                     "*prop": "reader",
84                                                     "id": "id",
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                                                 }
87                                             ]
88                                         },
89                                         {
90                                             "*prop": "footer",
91                                             "xtype": "PagingToolbar",
92                                             "pageSize": 25,
93                                             "displayInfo": true,
94                                             "displayMsg": "Displaying curr_symbol{0} - {1} of {2}",
95                                             "emptyMsg": "No curr_symbol found",
96                                             "|xns": "Roo"
97                                         },
98                                         {
99                                             "*prop": "toolbar",
100                                             "xtype": "Toolbar",
101                                             "|xns": "Roo",
102                                             "items": [
103                                                 {
104                                                     "|xns": "Roo.Toolbar",
105                                                     "xtype": "Fill"
106                                                 },
107                                                 {
108                                                     "text": "Add",
109                                                     "xtype": "Button",
110                                                     "cls": "x-btn-text-icon",
111                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
112                                                     "listeners": {
113                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
114                                                     },
115                                                     "|xns": "Roo.Toolbar"
116                                                 }
117                                             ]
118                                         },
119                                         {
120                                             "*prop": "colModel[]",
121                                             "dataIndex": "curr_name",
122                                             "header": "Name",
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_symbol",
131                                             "header": "Symbol",
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                                             "*prop": "colModel[]",
139                                             "dataIndex": "curr_abbr",
140                                             "header": "Abbr.",
141                                             "width": 80,
142                                             "xtype": "ColumnModel",
143                                             "|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}",
144                                             "|xns": "Roo.grid"
145                                         }
146                                     ]
147                                 }
148                             ]
149                         },
150                         {
151                             "listeners": {
152                                 "|activate": "function() {\n    _this.rpanel = this;\n    if (_this.rgrid) {\n        _this.rgrid.footer.onClick('first');\n    }\n}"
153                             },
154                             "background": false,
155                             "fitContainer": true,
156                             "fitToframe": true,
157                             "region": "center",
158                             "tableName": "curr_rate",
159                             "title": "curr_rate",
160                             "xtype": "GridPanel",
161                             "|xns": "Roo",
162                             "items": [
163                                 {
164                                     "listeners": {
165                                         "|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}",
166                                         "|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"
167                                     },
168                                     "*prop": "grid",
169                                     "autoExpandColumn": "curr_rate",
170                                     "loadMask": true,
171                                     "xtype": "Grid",
172                                     "|xns": "Roo.grid",
173                                     "items": [
174                                         {
175                                             "listeners": {
176                                                 "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}"
177                                             },
178                                             "*prop": "dataSource",
179                                             "remoteSort": true,
180                                             "xtype": "Store",
181                                             "|sortInfo": "{ field : '', direction: 'ASC' }",
182                                             "|xns": "Roo.data",
183                                             "items": [
184                                                 {
185                                                     "*prop": "proxy",
186                                                     "xtype": "HttpProxy",
187                                                     "method": "GET",
188                                                     "|url": "baseURL + '/Roo/curr_rate.php'",
189                                                     "|xns": "Roo.data"
190                                                 },
191                                                 {
192                                                     "|xns": "Roo.data",
193                                                     "xtype": "JsonReader",
194                                                     "totalProperty": "total",
195                                                     "root": "data",
196                                                     "*prop": "reader",
197                                                     "id": "id",
198                                                     "|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]"
199                                                 }
200                                             ]
201                                         },
202                                         {
203                                             "*prop": "footer",
204                                             "xtype": "PagingToolbar",
205                                             "pageSize": 25,
206                                             "displayInfo": true,
207                                             "displayMsg": "Displaying curr_rate{0} - {1} of {2}",
208                                             "emptyMsg": "No curr_rate found",
209                                             "|xns": "Roo"
210                                         },
211                                         {
212                                             "*prop": "toolbar",
213                                             "xtype": "Toolbar",
214                                             "|xns": "Roo",
215                                             "items": [
216                                                 {
217                                                     "|xns": "Roo.Toolbar",
218                                                     "xtype": "Fill"
219                                                 },
220                                                 {
221                                                     "text": "Add",
222                                                     "xtype": "Button",
223                                                     "cls": "x-btn-text-icon",
224                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
225                                                     "listeners": {
226                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
227                                                     },
228                                                     "|xns": "Roo.Toolbar"
229                                                 }
230                                             ]
231                                         },
232                                         {
233                                             "*prop": "colModel[]",
234                                             "dataIndex": "curr_effective",
235                                             "header": "From",
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                                             "dataIndex": "curr_expires",
244                                             "header": "To",
245                                             "width": 150,
246                                             "xtype": "ColumnModel",
247                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
248                                             "|xns": "Roo.grid"
249                                         },
250                                         {
251                                             "*prop": "colModel[]",
252                                             "align": "right",
253                                             "dataIndex": "curr_rate",
254                                             "header": "Rate",
255                                             "width": 75,
256                                             "xtype": "ColumnModel",
257                                             "|renderer": "function(v) { return String.format('{0}', v); }",
258                                             "|xns": "Roo.grid"
259                                         }
260                                     ]
261                                 }
262                             ]
263                         }
264                     ]
265                 }
266             ]
267         }
268     ],
269     "permname": "",
270     "modOrder": "901"
271 }