Pman.Dialog.XtupleSalesProductList.bjs
[Pman.Xtuple] / Pman.Dialog.XtupleSalesProductList.bjs
1 {
2     "id": "roo-file-30",
3     "name": "Pman.Dialog.XtupleSalesProductList",
4     "parent": "",
5     "title": "",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleSalesProductList.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "show": "function (_self)\n{\n   _this.grid.footer.onClick('first');\n}"
11             },
12             "closable": false,
13             "collapsible": false,
14             "height": 600,
15             "modal": true,
16             "resizable": false,
17             "title": "Products List",
18             "width": 1000,
19             "xtype": "LayoutDialog",
20             "|xns": "Roo",
21             "items": [
22                 {
23                     "|xns": "Roo",
24                     "xtype": "LayoutRegion",
25                     "*prop": "center"
26                 },
27                 {
28                     "listeners": {
29                         "|activate": "function() {\n    _this.panel = this;\n    \n //   if (_this.grid) {\n //       _this.grid.footer.onClick('first');\n //   }\n}"
30                     },
31                     "background": false,
32                     "fitContainer": true,
33                     "fitToframe": true,
34                     "region": "center",
35                     "tableName": "item",
36                     "title": "Products List",
37                     "xtype": "GridPanel",
38                     "|xns": "Roo",
39                     "items": [
40                         {
41                             "listeners": {
42                                 "|render": "function() \n{\n    _this.grid = this; \n  //  if (_this.panel.active) {\n//      this.footer.onClick('first');\n  //  }\n    \n}",
43                                 "rowdblclick": "function (_self, rowIndex, e)\n{\n    _this.dialog.hide();\n    if(!_this.callback){\n        return;\n    }\n    var s = this.ds.getAt(rowIndex);\n    if (s.data.item_id * 1 < 1 ) {\n        return;\n    }\n    \n    _this.callback.call(_this,s.data);\n}"
44                             },
45                             "*prop": "grid",
46                             "autoExpandColumn": "item_descrip1",
47                             "loadMask": true,
48                             "xtype": "Grid",
49                             "|xns": "Roo.grid",
50                             "items": [
51                                 {
52                                     "*prop": "sm",
53                                     "singleSelect": true,
54                                     "xtype": "RowSelectionModel",
55                                     "|xns": "Roo.grid"
56                                 },
57                                 {
58                                     "listeners": {
59                                         "beforeload": "function (_self, o)\n{\n      o.params._with_prodcat = 1;\n      o.params._with_char = 1;\n      o.params._with_itemsrc_active = 1;\n      o.params._with_last_purchase_price = 1;\n      o.params._with_image = 1;\n      o.params._with_itemsite = 1;\n\n      if(typeof(_this.data.cohead_cust_id) != 'undefined'){\n        o.params.cohead_cust_id = _this.data.cohead_cust_id;\n      }\n      \n      if(typeof(_this.data.cohead_id) != 'undefined'){\n        o.params.cohead_id = _this.data.cohead_id;\n      }\n      \n      var s = _this.searchBox.getValue();\n      if (!s.length) {\n            return false;\n        }\n        o.params['query[number_or_name]'] = s;\n      \n}"
60                                     },
61                                     "*prop": "dataSource",
62                                     "remoteSort": true,
63                                     "xtype": "Store",
64                                     "|sortInfo": "{ field : 'item_number', direction: 'ASC' }",
65                                     "|xns": "Roo.data",
66                                     "items": [
67                                         {
68                                             "*prop": "proxy",
69                                             "method": "GET",
70                                             "xtype": "HttpProxy",
71                                             "|url": "baseURL + '/Roo/item.php'",
72                                             "|xns": "Roo.data"
73                                         },
74                                         {
75                                             "*prop": "reader",
76                                             "id": "item_id",
77                                             "root": "data",
78                                             "totalProperty": "total",
79                                             "xtype": "JsonReader",
80                                             "|fields": "[\n    {\n        'name': 'item_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_number',\n        'type': 'string'\n    },\n    {\n        'name': 'item_descrip1',\n        'type': 'string'\n    },\n    {\n        'name': 'item_descrip2',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_picklist',\n        'type': 'int'\n    },\n    {\n        'name': 'item_comments',\n        'type': 'string'\n    },\n    {\n        'name': 'item_sold',\n        'type': 'int'\n    },\n    {\n        'name': 'item_fractional',\n        'type': 'int'\n    },\n    {\n        'name': 'item_active',\n        'type': 'int'\n    },\n    {\n        'name': 'item_type',\n        'type': 'string'\n    },\n    {\n        'name': 'item_prodweight',\n        'type': 'float'\n    },\n    {\n        'name': 'item_packweight',\n        'type': 'float'\n    },\n    {\n        'name': 'item_prodcat_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_exclusive',\n        'type': 'int'\n    },\n    {\n        'name': 'item_listprice',\n        'type': 'float'\n    },\n    {\n        'name': 'item_config',\n        'type': 'int'\n    },\n    {\n        'name': 'item_extdescrip',\n        'type': 'string'\n    },\n    {\n        'name': 'item_upccode',\n        'type': 'string'\n    },\n    {\n        'name': 'item_maxcost',\n        'type': 'float'\n    },\n    {\n        'name': 'item_inv_uom_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_price_uom_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_warrdays',\n        'type': 'int'\n    },\n    {\n        'name': 'item_freightclass_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_tax_recoverable',\n        'type': 'int'\n    },\n    {\n        'name': 'item_price_uom_id_uom_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_price_uom_id_uom_name',\n        'type': 'string'\n    },\n    {\n        'name': 'item_price_uom_id_uom_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'item_price_uom_id_uom_item_weight',\n        'type': 'int'\n    },\n    {\n        'name': 'item_inv_uom_id_uom_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_inv_uom_id_uom_name',\n        'type': 'string'\n    },\n    {\n        'name': 'item_inv_uom_id_uom_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'item_inv_uom_id_uom_item_weight',\n        'type': 'int'\n    },\n    {\n        'name': 'item_freightclass_id_freightclass_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_freightclass_id_freightclass_code',\n        'type': 'string'\n    },\n    {\n        'name': 'item_freightclass_id_freightclass_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id_classcode_id',\n        'type': 'int'\n    },\n    {\n        'name': 'item_classcode_id_classcode_code',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id_classcode_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id_classcode_mfg',\n        'type': 'int'\n    },\n    {\n        'name': 'item_classcode_id_classcode_creator',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id_classcode_created',\n        'type': 'date'\n    },\n    {\n        'name': 'item_classcode_id_classcode_modifier',\n        'type': 'string'\n    },\n    {\n        'name': 'item_classcode_id_classcode_modified',\n        'type': 'date'\n    },\n    {\n        'name': 'item_classcode_id_classcode_type',\n        'type': 'string'\n    }\n]",
81                                             "|xns": "Roo.data"
82                                         }
83                                     ]
84                                 },
85                                 {
86                                     "*prop": "footer",
87                                     "displayInfo": true,
88                                     "displayMsg": "Double click to select the item",
89                                     "emptyMsg": "No item found",
90                                     "pageSize": 25,
91                                     "xtype": "PagingToolbar",
92                                     "|xns": "Roo"
93                                 },
94                                 {
95                                     "*prop": "toolbar",
96                                     "xtype": "Toolbar",
97                                     "|xns": "Roo",
98                                     "items": [
99                                         {
100                                             "listeners": {
101                                                 "specialkey": "function (_self, e)\n{\n  _this.grid.footer.onClick('first');\n}",
102                                                 "render": "function (_self)\n{\n    _this.searchBox = _self;\n}"
103                                             },
104                                             "xtype": "TextField",
105                                             "|xns": "Roo.form"
106                                         },
107                                         {
108                                             "listeners": {
109                                                 "click": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
110                                             },
111                                             "cls": "x-btn-icon",
112                                             "xtype": "Button",
113                                             "|icon": "rootURL + '/Pman/templates/images/search.gif'",
114                                             "|xns": "Roo.Toolbar"
115                                         },
116                                         {
117                                             "listeners": {
118                                                 "click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\r\n    _this.status_type.setValue('');\r\n    _this.grid.footer.onClick('first');\r\n}"
119                                             },
120                                             "cls": "x-btn-icon",
121                                             "xtype": "Button",
122                                             "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
123                                             "|xns": "Roo.Toolbar"
124                                         }
125                                     ]
126                                 },
127                                 {
128                                     "*prop": "colModel[]",
129                                     "dataIndex": "item_char_brand",
130                                     "header": "Brand",
131                                     "sortable": true,
132                                     "width": 100,
133                                     "xtype": "ColumnModel",
134                                     "|renderer": "function(v) { return String.format('{0}', v); }",
135                                     "|xns": "Roo.grid"
136                                 },
137                                 {
138                                     "*prop": "colModel[]",
139                                     "dataIndex": "item_char_productgroup",
140                                     "header": "Product Group",
141                                     "width": 100,
142                                     "xtype": "ColumnModel",
143                                     "|renderer": "function(v) { return String.format('{0}', v); }",
144                                     "|xns": "Roo.grid"
145                                 },
146                                 {
147                                     "*prop": "colModel[]",
148                                     "dataIndex": "item_number",
149                                     "header": "Number",
150                                     "width": 75,
151                                     "xtype": "ColumnModel",
152                                     "|renderer": "function(v) { return String.format('{0}', v); }",
153                                     "|xns": "Roo.grid"
154                                 },
155                                 {
156                                     "*prop": "colModel[]",
157                                     "dataIndex": "item_descrip1",
158                                     "header": "Description",
159                                     "width": 200,
160                                     "xtype": "ColumnModel",
161                                     "|renderer": "function(v) { return String.format('{0}', v); }",
162                                     "|xns": "Roo.grid"
163                                 },
164                                 {
165                                     "*prop": "colModel[]",
166                                     "dataIndex": "itemsrc_active",
167                                     "header": "Purchased",
168                                     "width": 75,
169                                     "xtype": "ColumnModel",
170                                     "|renderer": "function(v) {  \n    var state = v * 1 > 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n                \n }",
171                                     "|xns": "Roo.grid"
172                                 },
173                                 {
174                                     "*prop": "colModel[]",
175                                     "dataIndex": "item_sold",
176                                     "header": "is Sold?",
177                                     "width": 50,
178                                     "xtype": "ColumnModel",
179                                     "|renderer": "function(v) {  \n    var state = v * 1 > 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n                \n }",
180                                     "|xns": "Roo.grid"
181                                 },
182                                 {
183                                     "*prop": "colModel[]",
184                                     "dataIndex": "item_active",
185                                     "header": "is Active?",
186                                     "width": 55,
187                                     "xtype": "ColumnModel",
188                                     "|renderer": "function(v) {  \n    var state = v * 1 > 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n                \n }",
189                                     "|xns": "Roo.grid"
190                                 },
191                                 {
192                                     "*prop": "colModel[]",
193                                     "dataIndex": "item_type",
194                                     "header": "Type",
195                                     "width": 50,
196                                     "xtype": "ColumnModel",
197                                     "|renderer": "function(v) { return String.format('{0}', v); }",
198                                     "|xns": "Roo.grid"
199                                 },
200                                 {
201                                     "*prop": "colModel[]",
202                                     "dataIndex": "item_prodcat_id_prodcat_code",
203                                     "header": "Item prodcat",
204                                     "width": 100,
205                                     "xtype": "ColumnModel",
206                                     "|renderer": "function(v) { return String.format('{0}', v); }",
207                                     "|xns": "Roo.grid"
208                                 }
209                             ]
210                         }
211                     ]
212                 },
213                 {
214                     "listeners": {
215                         "click": "function (_self, e)\n{\n    Pman.Dialog.XtupleItem.show(_this.data, function(){\n        _this.grid.footer.onClick('first');\n    });\n}"
216                     },
217                     "*prop": "buttons[]",
218                     "text": "Create New",
219                     "xtype": "Button",
220                     "|xns": "Roo"
221                 },
222                 {
223                     "listeners": {
224                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
225                     },
226                     "*prop": "buttons[]",
227                     "text": "Cancel",
228                     "xtype": "Button",
229                     "|xns": "Roo"
230                 }
231             ]
232         }
233     ],
234     "permname": "",
235     "modOrder": "001"
236 }