{ "id": "roo-file-73", "name": "Pman.Tab.XtupleTransfer", "parent": "Pman.Tab.XtupleSales", "title": "", "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleTransfer.bjs", "items": [ { "listeners": { "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "background": true, "fitContainer": true, "fitToframe": true, "region": "center", "tableName": "invhist_transfer", "title": "Transfers", "xtype": "GridPanel", "|xns": "Roo", "items": [ { "listeners": { "|render": "function() \n{\n _this.grid = this; \n _this.dialog =Pman.Dialog.XtupleTransfer;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", "|rowdblclick": "function (_self, rowIndex, e)\n{\n var sel = _this.postedCombo.getValue();\n \n var tdb = baseURL.split('/').pop().split('.').shift();\n \n \n if (sel.match(/^office-/)) {\n tdb = sel.split('-').pop();\n \n }\n \n \n if (!_this.dialog) return;\n \n var data = this.getDataSource().getAt(rowIndex).data;\n \n \n _this.dialog.show( {\n invhist_transfer_id : data.invhist_transfer_id,\n _roo_office : tdb\n }, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n", "rowclass": "function (gridview, rowcfg)\n{\n if(rowcfg.record.data.invhist_transfer_void){\n rowcfg.rowClass = 'strikethrough';\n }\n}" }, "*prop": "grid", "autoExpandColumn": "invhist_transfer_descrip", "loadMask": true, "xtype": "Grid", "|xns": "Roo.grid", "items": [ { "listeners": { "beforeload": "function (_self, o)\n{\n var tdb = baseURL.split('/').pop().split('.').shift(); \n o.params._roo_office = tdb;\n o.params['query[location_id]'] = _this.locCombo.getValue();\n o.params['query[invhist_transfer_number]'] = _this.searchBox.getValue();\n var sel = _this.postedCombo.getValue();\n switch (sel) {\n case 'VOIDED': \n o.params.invhist_transfer_void = 1; \n break;\n case 'POSTED': \n o.params.invhist_transfer_posted = 1; \n break;\n case 'UNPOSTED': \n o.params.invhist_transfer_posted = 0; \n o.params.invhist_transfer_void = 0; \n break; \n case 'ALL': \n break;\n default: \n if (!sel.match(/^office-/)) {\n break;\n }\n delete o.params['query[location_id]'];\n \n o.params._roo_office= sel.replace(/^office-/,'');\n o.params.cust_to_internalcompany = tdb;\n break;\n }\n var dt = _this.dateSel.getValue();\n \n o.params['query[dateSel]'] = typeof(dt) == 'string' ? dt : dt.format('Y-m-d');\n \n\n \n \n}" }, "*prop": "dataSource", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ field : 'invhist_transfer_transdate', direction: 'DESC' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Xtuple/Roo/invhist_transfer.php'", "|xns": "Roo.data" }, { "|xns": "Roo.data", "xtype": "JsonReader", "totalProperty": "total", "root": "data", "*prop": "reader", "id": "id", "|fields": "[\n {\n 'name': 'invhist_transfer_id',\n 'type': 'int'\n },\n {\n 'name': 'invhist_transfer_transdate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'invhist_transfer_number',\n 'type': 'string'\n },\n {\n 'name': 'invhist_transfer_from',\n 'type': 'int'\n },\n {\n 'name': 'invhist_transfer_to',\n 'type': 'int'\n },\n {\n 'name': 'invhist_transfer_descrip',\n 'type': 'string'\n }\n]" } ] }, { "*prop": "footer", "xtype": "PagingToolbar", "pageSize": 25, "displayInfo": true, "displayMsg": "Displaying invhist_transfer{0} - {1} of {2}", "emptyMsg": "No invhist_transfer found", "|xns": "Roo", "items": [ { "listeners": { "click": "function (_self, e)\n{\n new Pman.Download({\n grid : _this.grid\n });\n Roo.MessageBox.alert(\"Downloading\", \"Report is downloading\");\n}" }, "text": "Download", "xtype": "Button", "|xns": "Roo.Toolbar" } ] }, { "*prop": "toolbar", "xtype": "Toolbar", "|xns": "Roo", "items": [ { "listeners": { "render": "function (_self)\n{\n _this.searchBox = _self;\n}", "specialkey": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}" }, "xtype": "TextField", "|xns": "Roo.form" }, { "listeners": { "select": "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}", "render": "function (_self)\n{\n _this.locCombo = _self;\n}" }, "allowBlank": true, "displayField": "location_name", "editable": true, "emptyText": "Select location", "fieldLabel": "location", "forceSelection": true, "hiddenName": "location_id", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "location_id", "pageSize": 200, "qtip": "Select location", "queryParam": "query[location_name]", "selectOnFocus": true, "tpl": "