{
- "id": "roo-file-358",
+ "id": "roo-file-39",
"name": "Pman.Dialog.XtupleVendorEdit",
"parent": "",
"title": "",
- "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleVendorEdit.bjs",
+ "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleVendorEdit.bjs",
"items": [
{
"listeners": {
"modal": true,
"resizable": false,
"title": "Edit / Create Vendor",
- "width": 550,
+ "width": 600,
"xtype": "LayoutDialog",
"|xns": "Roo",
"items": [
"items": [
{
"listeners": {
- "beforeload": "function (_self, options)\n{\n options.params.itemsrc_vend_id = _this.form.findField('vend_id').getValue();\n}"
+ "beforeload": "function (_self, options)\n{\n options.params.itemsrc_vend_id = _this.form.findField('vend_id').getValue();\n var s = _this.searchBox.getValue();\n if (s.length) {\n options.params['search[name]'] = s;\n }\n}"
},
"*prop": "dataSource",
"remoteSort": true,
},
{
"*prop": "footer",
- "xtype": "PagingToolbar",
- "pageSize": 25,
"displayInfo": true,
"displayMsg": "Displaying itemsrc{0} - {1} of {2}",
"emptyMsg": "No itemsrc found",
+ "pageSize": 100,
+ "xtype": "PagingToolbar",
"|xns": "Roo"
},
{
"items": [
{
"listeners": {
- "render": "function (_self)\n{\n _this.searchBox = _self;\n}"
+ "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 _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": "Fill"
}
]
},
+ {
+ "listeners": {
+ "|activate": "function() {\n _this.apanel = this;\n if (_this.agrid) {\n _this.agrid.footer.onClick('first');\n }\n}"
+ },
+ "background": true,
+ "fitContainer": true,
+ "fitToframe": true,
+ "region": "center",
+ "tableName": "vendaddrinfo",
+ "title": "Addresses",
+ "xtype": "GridPanel",
+ "|xns": "Roo",
+ "items": [
+ {
+ "listeners": {
+ "|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_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}"
+ },
+ "*prop": "dataSource",
+ "remoteSort": true,
+ "xtype": "Store",
+ "|sortInfo": "{ field : 'vendaddr_id', direction: 'ASC' }",
+ "|xns": "Roo.data",
+ "items": [
+ {
+ "*prop": "proxy",
+ "method": "GET",
+ "xtype": "HttpProxy",
+ "|url": "baseURL + '/Roo/vendaddrinfo.php'",
+ "|xns": "Roo.data"
+ },
+ {
+ "*prop": "reader",
+ "id": "vendaddr_id",
+ "root": "data",
+ "totalProperty": "total",
+ "xtype": "JsonReader",
+ "|fields": "[\n {\n 'name': 'vendaddr_id',\n 'type': 'int'\n },\n {\n 'name': 'vendaddr_vend_id',\n 'type': 'int'\n },\n {\n 'name': 'vendaddr_code',\n 'type': 'string'\n }\n]",
+ "|xns": "Roo.data"
+ }
+ ]
+ },
+ {
+ "*prop": "footer",
+ "displayInfo": true,
+ "displayMsg": "Displaying address{0} - {1} of {2}",
+ "emptyMsg": "Nothing found",
+ "pageSize": 100,
+ "xtype": "PagingToolbar",
+ "|xns": "Roo"
+ },
+ {
+ "*prop": "toolbar",
+ "xtype": "Toolbar",
+ "|xns": "Roo",
+ "items": [
+ {
+ "|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": 75,
+ "xtype": "ColumnModel",
+ "|renderer": "function(v) { return String.format('{0}', v); }",
+ "|xns": "Roo.grid"
+ },
+ {
+ "*prop": "colModel[]",
+ "dataIndex": "vendaddr_addr_id_addr_city",
+ "header": "District",
+ "width": 100,
+ "xtype": "ColumnModel",
+ "|renderer": "function(v) { return String.format('{0}', v); }",
+ "|xns": "Roo.grid"
+ },
+ {
+ "*prop": "colModel[]",
+ "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": "vendaddr_addr_id_addr_line2",
+ "header": "Address Line 2",
+ "width": 200,
+ "xtype": "ColumnModel",
+ "|renderer": "function(v) { return String.format('{0}', v); }",
+ "|xns": "Roo.grid"
+ }
+ ]
+ }
+ ]
+ },
{
"listeners": {
"click": "function (_self, e)\n{\n _this.dialog.hide();\n}"