{
- "id": "roo-file-38",
+ "id": "roo-file-39",
"name": "Pman.Dialog.XtupleVendorEdit",
"parent": "",
"title": "",
"modal": true,
"resizable": false,
"title": "Edit / Create Vendor",
- "width": 550,
+ "width": 600,
"xtype": "LayoutDialog",
"|xns": "Roo",
"items": [
"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}"
{
"|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"
}
]
},
"*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); }",
},
{
"*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"