{
"id": "roo-file-352",
"name": "Pman.Dialog.XtupleSalesProductList",
"parent": "",
"title": "",
"path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleSalesProductList.bjs",
"items": [
{
"listeners": {
"show": "function (_self)\n{\n _this.grid.footer.onClick('first');\n}"
},
"closable": false,
"collapsible": false,
"height": 600,
"modal": true,
"resizable": false,
"title": "Products List",
"width": 1000,
"xtype": "LayoutDialog",
"|xns": "Roo",
"items": [
{
"|xns": "Roo",
"xtype": "LayoutRegion",
"*prop": "center"
},
{
"listeners": {
"|activate": "function() {\n _this.panel = this;\n \n // if (_this.grid) {\n // _this.grid.footer.onClick('first');\n // }\n}"
},
"background": false,
"fitContainer": true,
"fitToframe": true,
"region": "center",
"tableName": "item",
"title": "Products List",
"xtype": "GridPanel",
"|xns": "Roo",
"items": [
{
"listeners": {
"|render": "function() \n{\n _this.grid = this; \n // if (_this.panel.active) {\n// this.footer.onClick('first');\n // }\n \n}",
"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}"
},
"*prop": "grid",
"autoExpandColumn": "item_descrip1",
"loadMask": true,
"xtype": "Grid",
"|xns": "Roo.grid",
"items": [
{
"*prop": "sm",
"singleSelect": false,
"xtype": "RowSelectionModel",
"|xns": "Roo.grid"
},
{
"listeners": {
"beforeload": "function (_self, o)\n{\n o.params._with_prodcat = 1;\n o.params._with_char = 1;\n if (!_this.data.exclude_itemsrc_vendor) {\n \n o.params._with_itemsrc_active = 1;\n }\n o.params._with_last_purchase_price = 1;\n o.params._with_itemsite = 1;\n o.params._with_image = 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 o.params['query[number_or_name]'] = s;\n }\n if (_this.data.exclude_itemsrc_vendor) {\n o.params._exclude_itemsrc_vendor = _this.data.exclude_itemsrc_vendor;\n } \n \n _this.addSelected.show();\n if (!_this.data.multi_select) {\n _this.addSelected.hide();\n }\n \n}"
},
"*prop": "dataSource",
"remoteSort": true,
"xtype": "Store",
"|sortInfo": "{ field : 'item_number', direction: 'ASC' }",
"|xns": "Roo.data",
"items": [
{
"*prop": "proxy",
"method": "GET",
"xtype": "HttpProxy",
"|url": "baseURL + '/Roo/item.php'",
"|xns": "Roo.data"
},
{
"*prop": "reader",
"id": "item_id",
"root": "data",
"totalProperty": "total",
"xtype": "JsonReader",
"|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]",
"|xns": "Roo.data"
}
]
},
{
"*prop": "footer",
"displayInfo": true,
"displayMsg": "Double click to select the item",
"emptyMsg": "No item found",
"pageSize": 25,
"xtype": "PagingToolbar",
"|xns": "Roo"
},
{
"*prop": "toolbar",
"xtype": "Toolbar",
"|xns": "Roo",
"items": [
{
"listeners": {
"specialkey": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}",
"render": "function (_self)\n{\n _this.searchBox = _self;\n}"
},
"xtype": "TextField",
"|xns": "Roo.form"
},
{
"listeners": {
"click": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}"
},
"cls": "x-btn-icon",
"xtype": "Button",
"|icon": "rootURL + '/Pman/templates/images/search.gif'",
"|xns": "Roo.Toolbar"
},
{
"listeners": {
"click": "function (_self, e)\n{\n _this.searchBox.setValue('');\r\n _this.status_type.setValue('');\r\n _this.grid.footer.onClick('first');\r\n}"
},
"cls": "x-btn-icon",
"xtype": "Button",
"|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
"|xns": "Roo.Toolbar"
}
]
},
{
"*prop": "colModel[]",
"dataIndex": "item_image_id",
"header": "Image",
"width": 100,
"xtype": "ColumnModel",
"|renderer": "function(v,x,r) { return String.format('', baseURL, v, r.data.item_image_filename); }",
"|xns": "Roo.grid"
},
{
"*prop": "colModel[]",
"dataIndex": "item_char_brand",
"header": "Brand",
"sortable": true,
"width": 100,
"xtype": "ColumnModel",
"|renderer": "function(v) { return String.format('{0}', v); }",
"|xns": "Roo.grid"
},
{
"*prop": "colModel[]",
"dataIndex": "item_char_productgroup",
"header": "Product Group",
"width": 100,
"xtype": "ColumnModel",
"|renderer": "function(v) { return String.format('{0}', v); }",
"|xns": "Roo.grid"
},
{
"*prop": "colModel[]",
"dataIndex": "item_number",
"header": "Number",
"width": 75,
"xtype": "ColumnModel",
"|renderer": "function(v) { return String.format('{0}', v); }",
"|xns": "Roo.grid"
},
{
"*prop": "colModel[]",
"dataIndex": "item_descrip1",
"header": "Description",
"width": 200,
"xtype": "ColumnModel",
"|renderer": "function(v) { return String.format('{0}', v); }",
"|xns": "Roo.grid"
},
{
"*prop": "colModel[]",
"dataIndex": "itemsrc_active",
"header": "Purchased",
"width": 75,
"xtype": "ColumnModel",
"|renderer": "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '';\n \n }",
"|xns": "Roo.grid"
},
{
"*prop": "colModel[]",
"dataIndex": "item_sold",
"header": "is Sold?",
"width": 50,
"xtype": "ColumnModel",
"|renderer": "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '';\n \n }",
"|xns": "Roo.grid"
},
{
"*prop": "colModel[]",
"dataIndex": "item_active",
"header": "is Active?",
"width": 55,
"xtype": "ColumnModel",
"|renderer": "function(v) { \n var state = v * 1 > 0 ? '-checked' : '';\n\n return '';\n \n }",
"|xns": "Roo.grid"
},
{
"*prop": "colModel[]",
"dataIndex": "item_type",
"header": "Type",
"width": 50,
"xtype": "ColumnModel",
"|renderer": "function(v) { return String.format('{0}', v); }",
"|xns": "Roo.grid"
},
{
"*prop": "colModel[]",
"dataIndex": "item_prodcat_id_prodcat_code",
"header": "Item prodcat",
"width": 100,
"xtype": "ColumnModel",
"|renderer": "function(v) { return String.format('{0}', v); }",
"|xns": "Roo.grid"
}
]
}
]
},
{
"listeners": {
"click": "function (_self, e)\n{\n\n if(!_this.callback){\n _this.dialog.hide();\n return;\n }\n var sels = _this.grid.selModel.getSelections();\n if (!sels.length) {\n Roo.MessageBox.alert(\"Error\", \"Select some items\");\n }\n _this.dialog.hide();\n _this.callback.call(_this,sels);\n}",
"render": "function (_self)\n{\n _this.addSelected = _self;\n}"
},
"*prop": "buttons[]",
"text": "Add Selected",
"xtype": "Button",
"|xns": "Roo"
},
{
"listeners": {
"click": "function (_self, e)\n{\n Pman.Dialog.XtupleItem.show({item_id : 0}, function(){\n _this.grid.footer.onClick('first');\n });\n}"
},
"*prop": "buttons[]",
"text": "Create New",
"xtype": "Button",
"|xns": "Roo"
},
{
"listeners": {
"click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
},
"*prop": "buttons[]",
"text": "Cancel",
"xtype": "Button",
"|xns": "Roo"
}
]
}
],
"permname": "",
"modOrder": "001"
}