Pman.Tab.XtuplePriceLists.bjs
[Pman.Xtuple] / Pman.Tab.XtuplePriceLists.bjs
1 {
2     "id": "roo-file-374",
3     "name": "Pman.Tab.XtuplePriceLists",
4     "parent": "Pman.Tab.XtupleManage",
5     "title": "Pman.Tab.XtuplePriceLists",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtuplePriceLists.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "ipshead",
17             "title": "Price Lists",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "listeners": {
23                         "|render": "function() \n{\n    _this.grid = this; \n    _this.dialog = Pman.Dialog.XtuplePriceList\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
24                         "|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}\n"
25                     },
26                     "*prop": "grid",
27                     "autoExpandColumn": "ipshead_descrip",
28                     "loadMask": true,
29                     "xtype": "Grid",
30                     "|xns": "Roo.grid",
31                     "items": [
32                         {
33                             "*prop": "dataSource",
34                             "xtype": "Store",
35                             "remoteSort": true,
36                             "|sortInfo": "{ field : 'ipshead_name', direction: 'ASC' }",
37                             "|xns": "Roo.data",
38                             "items": [
39                                 {
40                                     "*prop": "proxy",
41                                     "xtype": "HttpProxy",
42                                     "method": "GET",
43                                     "|url": "baseURL + '/Roo/ipshead.php'",
44                                     "|xns": "Roo.data"
45                                 },
46                                 {
47                                     "|xns": "Roo.data",
48                                     "xtype": "JsonReader",
49                                     "totalProperty": "total",
50                                     "root": "data",
51                                     "*prop": "reader",
52                                     "id": "id",
53                                     "|fields": "[\n    {\n        'name': 'ipshead_id',\n        'type': 'int'\n    },\n    {\n        'name': 'ipshead_name',\n        'type': 'string'\n    },\n    {\n        'name': 'ipshead_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'ipshead_effective',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'ipshead_expires',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'ipshead_curr_id',\n        'type': 'int'\n    },\n    {\n        'name': 'ipshead_updated',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'ipshead_curr_id_curr_id',\n        'type': 'int'\n    },\n    {\n        'name': 'ipshead_curr_id_curr_base',\n        'type': 'int'\n    },\n    {\n        'name': 'ipshead_curr_id_curr_name',\n        'type': 'string'\n    },\n    {\n        'name': 'ipshead_curr_id_curr_symbol',\n        'type': 'string'\n    },\n    {\n        'name': 'ipshead_curr_id_curr_abbr',\n        'type': 'string'\n    }\n]"
54                                 }
55                             ]
56                         },
57                         {
58                             "*prop": "footer",
59                             "displayInfo": true,
60                             "displayMsg": "Displaying ipshead{0} - {1} of {2}",
61                             "emptyMsg": "No ipshead found",
62                             "pageSize": 25,
63                             "xtype": "PagingToolbar",
64                             "|xns": "Roo"
65                         },
66                         {
67                             "*prop": "toolbar",
68                             "xtype": "Toolbar",
69                             "|xns": "Roo",
70                             "items": [
71                                 {
72                                     "listeners": {
73                                         "click": "function (_self, e)\n{\n   new Pman.Download({\n        method: 'GET',\n        url : baseURL + '/Roo/Ipsiteminfo',\n        params : {\n            _pricegrid : 1\n        }\n   });\n}"
74                                     },
75                                     "text": "Download Price Matrix",
76                                     "xtype": "Button",
77                                     "|xns": "Roo.Toolbar"
78                                 },
79                                 {
80                                     "listeners": {
81                                         "click": "function (_self, e)\n{\n   Pman.Dialog.Image.show(\n       {\n            _url : baseURL+'/Xtuple/Pricing'\n        \n       },\n       function (data) {\n            var msg = [];\n            if (data.deleted) {\n                msg.push(\"Deleted \" + data.deleted + \" Price(s)\");\n            }\n            if (data.updated) {\n                msg.push(\"Updated \" + data.updated + \" Price(s)\");\n            }            \n            if (data.inserted) {\n                msg.push(\"Added \" + data.inserted + \" Price(s)\");\n            }\n            if (!msg.length) {\n                msg.push(\"No data changed\");\n            }\n            Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n       }\n   );\n}"
82                                     },
83                                     "text": "Upload Price Matrix",
84                                     "xtype": "Button",
85                                     "|xns": "Roo.Toolbar"
86                                 },
87                                 {
88                                     "|xns": "Roo.Toolbar",
89                                     "xtype": "Fill"
90                                 },
91                                 {
92                                     "text": "Add",
93                                     "xtype": "Button",
94                                     "cls": "x-btn-text-icon",
95                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
96                                     "listeners": {
97                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
98                                     },
99                                     "|xns": "Roo.Toolbar"
100                                 },
101                                 {
102                                     "text": "Delete",
103                                     "cls": "x-btn-text-icon",
104                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
105                                     "xtype": "Button",
106                                     "listeners": {
107                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'ipshead'); \n}\n        "
108                                     },
109                                     "|xns": "Roo.Toolbar"
110                                 }
111                             ]
112                         },
113                         {
114                             "*prop": "colModel[]",
115                             "dataIndex": "ipshead_curr_id_curr_name",
116                             "header": "Ipshead curr",
117                             "sortable": true,
118                             "width": 75,
119                             "xtype": "ColumnModel",
120                             "|renderer": "function(v) { return String.format('{0}', v); }",
121                             "|xns": "Roo.grid"
122                         },
123                         {
124                             "*prop": "colModel[]",
125                             "dataIndex": "ipshead_name",
126                             "header": "Ipshead name",
127                             "sortable": true,
128                             "width": 200,
129                             "xtype": "ColumnModel",
130                             "|renderer": "function(v) { return String.format('{0}', v); }",
131                             "|xns": "Roo.grid"
132                         },
133                         {
134                             "xtype": "ColumnModel",
135                             "header": "Ipshead descrip",
136                             "width": 200,
137                             "dataIndex": "ipshead_descrip",
138                             "|renderer": "function(v) { return String.format('{0}', v); }",
139                             "|xns": "Roo.grid",
140                             "*prop": "colModel[]"
141                         },
142                         {
143                             "xtype": "ColumnModel",
144                             "header": "Ipshead effective",
145                             "width": 75,
146                             "dataIndex": "ipshead_effective",
147                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
148                             "|xns": "Roo.grid",
149                             "*prop": "colModel[]"
150                         },
151                         {
152                             "*prop": "colModel[]",
153                             "dataIndex": "ipshead_expires",
154                             "header": "Ipshead expires",
155                             "width": 75,
156                             "xtype": "ColumnModel",
157                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
158                             "|xns": "Roo.grid"
159                         },
160                         {
161                             "xtype": "ColumnModel",
162                             "header": "Ipshead updated",
163                             "width": 75,
164                             "dataIndex": "ipshead_updated",
165                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
166                             "|xns": "Roo.grid",
167                             "*prop": "colModel[]"
168                         }
169                     ]
170                 }
171             ]
172         }
173     ],
174     "permname": "",
175     "modOrder": "001"
176 }