X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Pman.Dialog.XtupleVendorEdit.bjs;h=21f99662c848da68da6ae307bd9867ace836fd8e;hb=HEAD;hp=784f93259162554a3e76ab95abeb700fa59436ee;hpb=3841347343eb480780c8d5f6dfc762186d579602;p=Pman.Xtuple diff --git a/Pman.Dialog.XtupleVendorEdit.bjs b/Pman.Dialog.XtupleVendorEdit.bjs index 784f9325..21f99662 100644 --- a/Pman.Dialog.XtupleVendorEdit.bjs +++ b/Pman.Dialog.XtupleVendorEdit.bjs @@ -1,5 +1,5 @@ { - "id": "roo-file-38", + "id": "roo-file-39", "name": "Pman.Dialog.XtupleVendorEdit", "parent": "", "title": "", @@ -15,7 +15,7 @@ "modal": true, "resizable": false, "title": "Edit / Create Vendor", - "width": 550, + "width": 600, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ @@ -605,14 +605,20 @@ "items": [ { "listeners": { - "|render": "function() \n{\n _this.sgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.spanel.active) {\n this.footer.onClick('first');\n }\n}" + "|render": "function() \n{\n _this.agrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.apanel.active) {\n this.footer.onClick('first');\n }\n}" }, "*prop": "grid", - "autoExpandColumn": "vendaddr_code", + "autoExpandColumn": "vendaddr_addr_id_addr_line1", "loadMask": true, "xtype": "Grid", "|xns": "Roo.grid", "items": [ + { + "*prop": "sm", + "singleSelect": true, + "xtype": "RowSelectionModel", + "|xns": "Roo.grid" + }, { "listeners": { "beforeload": "function (_self, options)\n{\n options.params = options.params || {};\n \n var id = _this.form.findField('vend_id').getValue();\n \n if(id * 1 < 1){\n return false;\n }\n \n options.params.vendaddr_vend_id = id;\n}" @@ -658,6 +664,34 @@ { "|xns": "Roo.Toolbar", "xtype": "Fill" + }, + { + "listeners": { + "click": "function (_self, e)\n{\n var id = _this.form.findField('vend_id').getValue();\n \n if(id * 1 < 1){\n Roo.MessageBox.alert('Error', 'Please save the vendor first');\n return;\n }\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Xtuple/Import/VendAddrInfo?' + Roo.urlEncode({'vend_id' : id})\n \n },\n function (data) {\n _this.agrid.footer.onClick('first');\n }\n );\n}" + }, + "text": "Upload", + "xtype": "Button", + "|xns": "Roo.Toolbar" + }, + { + "listeners": { + "|click": "function()\n{\n var s = _this.agrid.getSelectionModel().getSelected();\n \n if(!s || s.data.vendaddr_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/vendaddrinfo',\n params : {\n _delete : s.data.vendaddr_id\n },\n success : function() {\n _this.agrid.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()\n{\n var s = _this.form.findField('vend_id').getValue() * 1;\n \n if(!s || s * 1 < 1){\n Roo.MessageBox.alert('Error', 'Save first!');\n return;\n }\n \n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete all the address?\",\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 vend_id : s,\n _remove_addr : 1\n },\n success : function() {\n _this.agrid.footer.onClick('refresh');\n }\n });\n });\n}\n " + }, + "cls": "x-btn-text-icon", + "text": "Delete All", + "xtype": "Button", + "|icon": "rootURL + '/Pman/templates/images/trash.gif'", + "|xns": "Roo.Toolbar" } ] }, @@ -665,15 +699,15 @@ "*prop": "colModel[]", "dataIndex": "vendaddr_code", "header": "Code", - "width": 100, + "width": 75, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", - "dataIndex": "vendaddr_name", - "header": "Name", + "dataIndex": "vendaddr_addr_id_addr_city", + "header": "District", "width": 100, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", @@ -681,18 +715,18 @@ }, { "*prop": "colModel[]", - "dataIndex": "itemsrc_leadtime", - "header": "Lead time", - "width": 75, + "dataIndex": "vendaddr_addr_id_addr_line1", + "header": "Address Line 1", + "width": 200, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", - "dataIndex": "itemsrc_active", - "header": "Active", - "width": 75, + "dataIndex": "vendaddr_addr_id_addr_line2", + "header": "Address Line 2", + "width": 200, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid"