{ "id": "roo-file-60", "name": "Pman.Tab.XtuplePurchasesVendors", "parent": "Pman.Tab.XtuplePurchases", "title": "", "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtuplePurchasesVendors.bjs", "items": [ { "background": true, "fitContainer": true, "fitToFrame": true, "region": "center", "title": "Vendors", "xtype": "NestedLayoutPanel", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "BorderLayout", "*prop": "layout", "items": [ { "|xns": "Roo", "xtype": "LayoutRegion", "*prop": "center" }, { "listeners": { "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "background": false, "fitContainer": true, "fitToframe": true, "region": "center", "tableName": "vendinfo", "title": "Vendors", "xtype": "GridPanel", "|xns": "Roo", "items": [ { "listeners": { "|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}", "rowdblclick": "function (_self, rowIndex, e)\n{\n var s = _this.grid.ds.getAt(rowIndex);\n if(s.data.vend_id * 1 < 1){\n Roo.MessageBox.alert(\"Error\", \"Select a row\");\n }\n \n Pman.Dialog.XtupleVendorEdit.show(s.data, function() {\n _this.grid.footer.onClick('first');\n }); \n}" }, "*prop": "grid", "autoExpandColumn": "vend_name", "loadMask": true, "xtype": "Grid", "|xns": "Roo.grid", "items": [ { "*prop": "sm", "singleSelect": true, "xtype": "RowSelectionModel", "|xns": "Roo.grid" }, { "listeners": { "beforeload": "function (_self, options)\n{\n \n if (! _this.searchBox) {\n // not rendered yet...\n return false;\n \n }\n options.params = options.params || {};\n options.params._with_char = 1;\n options.params['search[name]'] = _this.searchBox.getValue();\n \n if (!_this.active.pressed) {\n options.params.vend_active = 1;\n } \n}" }, "*prop": "dataSource", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ field : 'vend_name', direction: 'ASC' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/Vendinfo.php'", "|xns": "Roo.data" }, { "*prop": "reader", "id": "vend_id", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[\n {\n 'name': 'vend_id',\n 'type': 'int'\n },\n {\n 'name': 'vend_name',\n 'type': 'string'\n }\n]", "|xns": "Roo.data" } ] }, { "*prop": "footer", "displayInfo": true, "displayMsg": "Displaying vendinfo{0} - {1} of {2}", "emptyMsg": "No vendinfo found", "pageSize": 25, "xtype": "PagingToolbar", "|xns": "Roo" }, { "*prop": "toolbar", "xtype": "Toolbar", "|xns": "Roo", "items": [ { "text": "Search : ", "xtype": "TextItem", "|xns": "Roo.Toolbar" }, { "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": { "|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('');\n \n \n _this.grid.footer.onClick('first');\n}" }, "cls": "x-btn-icon", "xtype": "Button", "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'", "|xns": "Roo.Toolbar" }, { "|xns": "Roo.Toolbar", "xtype": "Separator" }, { "listeners": { "toggle": "function (_self, pressed)\n{\n\n this.setText(pressed ? \"Hide Inactive\" : \"Show Inactive\");\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}", "render": "function (_self)\n{\n _this.active = _self;\n}" }, "enableToggle": true, "text": "Show Inactive", "xtype": "Button", "|xns": "Roo.Toolbar" }, { "|xns": "Roo.Toolbar", "xtype": "Fill" }, { "listeners": { "|click": "function()\n{\n\n Pman.Dialog.XtupleVendorEdit.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" }, "cls": "x-btn-text-icon", "text": "Add", "xtype": "Button", "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'", "|xns": "Roo.Toolbar" }, { "listeners": { "|click": "function()\n{\n var s = _this.grid.getSelectionModel().getSelected();\n \n if(!s || s.data.vend_id * 1 < 1){\n Roo.MessageBox.alert('Error', 'Please select a row');\n return;\n }\n \n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete that?\",\n function(v) {\n if (v != 'yes') {\n return;\n }\n new Pman.Request({\n method: 'POST',\n url: baseURL+ '/Roo/vendinfo',\n params : {\n _delete : s.data.vend_id\n },\n success : function() {\n _this.grid.footer.onClick('refresh');\n }\n });\n });\n}\n " }, "cls": "x-btn-text-icon", "text": "Delete", "xtype": "Button", "|icon": "rootURL + '/Pman/templates/images/trash.gif'", "|xns": "Roo.Toolbar" }, { "listeners": { "click": "function (_self, e)\n{\n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/Vendors' \n \n },\n function (data) {\n _this.grid.footer.onClick('first');\n Roo.MessageBox.alert(\"Notice\", \"DONE\");\n// Roo.MessageBox.alert(\"Notice\", msg.join(\"\\n\"));\n\n }\n );\n}" }, "text": "Upload Vendors", "xtype": "Button", "|xns": "Roo.Toolbar" } ] }, { "*prop": "colModel[]", "dataIndex": "vend_name", "header": "Name", "width": 100, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "vend_vendtype_id_vendtype_descrip", "header": "Type", "width": 150, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "vend_char_internalcompany", "header": "Internal?", "width": 100, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }", "|xns": "Roo.grid" } ] } ] } ] } ] } ], "permname": "", "modOrder": "300" }