{ "id": "roo-file-0", "name": "Pman.Dialog.XtupleAddress", "parent": "Pman", "title": "", "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleAddress.bjs", "items": [ { ".builderCfg": "{\"cols\":[{\"table\":\"addr\",\"column\":\"addr_id\",\"columnshort\":\"addr_id\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\",\"display\":\"addr_id\"},{\"table\":\"addr\",\"column\":\"addr_active\",\"columnshort\":\"addr_active\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_line1\",\"columnshort\":\"addr_line1\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_line2\",\"columnshort\":\"addr_line2\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_line3\",\"columnshort\":\"addr_line3\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_city\",\"columnshort\":\"addr_city\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_state\",\"columnshort\":\"addr_state\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_postalcode\",\"columnshort\":\"addr_postalcode\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_country\",\"columnshort\":\"addr_country\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_notes\",\"columnshort\":\"addr_notes\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_number\",\"columnshort\":\"addr_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"addr_id\"],\"table\":\"addr\",\"xtype\":\"LayoutDialog\",\"|xns\":\"Roo\"}", "closable": false, "collapsible": false, "height": 400, "modal": true, "resizable": false, "title": "Edit Address", "width": 500, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "LayoutRegion", "*prop": "center" }, { "region": "center", "xtype": "ContentPanel", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "Toolbar", "*prop": "toolbar", "items": [ { "|xns": "Roo.Toolbar", "xtype": "Fill" }, { "listeners": { "click": "function()\n{\n var id = _this.form.findField('addr_id').getValue() *1;\n if (!id) {\n Roo.MessageBox.alert(\"Error\", \"You can not delete this, you have not created it yet\");\n return;\n }\n \n \n Roo.MessageBox.confirm(\"Confirm\", \"You will only be able to delete this if it is not referenced anywhere
\"+\n \", are you sure you want to try that?\",\n function (res) {\n if(res!='yes') {\n return;\n \n }\n new Pman.Request({\n method: 'POST',\n url: baseURL+ '/Roo/addr',\n params : {\n _delete : id\n },\n success : function() {\n _this.callback({ addr_id : 0, addr_line1 : '' });\n _this.dialog.hide();\n }\n });\n });\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": { "|actioncomplete": "function(_self,action)\n{\n if (action.type == 'setdata') {\n if (_this.data.addr_id) { \n this.load({ method: 'GET', params: { '_id' : _this.data.addr_id }});\n }\n return;\n }\n if (action.type == 'load') {\n return;\n }\n if (action.type =='submit') {\n \n _this.dialog.hide();\n \n if (_this.callback) {\n _this.form.setValues(action.result.data);\n _this.callback.call(_this, _this.form.getValues());\n }\n _this.form.reset();\n return;\n }\n}\n", "|rendered": "function (form)\n{\n _this.form= form;\n}\n" }, "method": "POST", "style": "margin:10px;", "xtype": "Form", "|url": "baseURL + '/Roo/addr.php'", "|xns": "Roo.form", "items": [ { "listeners": { "keyup": "function (_self, e)\n{\n _this.form.findField('addr_number').sync();\n}" }, "allowBlank": false, "fieldLabel": "Line 1", "name": "addr_line1", "width": 300, "xtype": "TextField", "|xns": "Roo.form" }, { "fieldLabel": "Line 2", "name": "addr_line2", "width": 300, "xtype": "TextField", "|xns": "Roo.form" }, { "fieldLabel": "Line 3", "name": "addr_line3", "width": 300, "xtype": "TextField", "|xns": "Roo.form" }, { "fieldLabel": "City", "name": "addr_city", "width": 300, "xtype": "TextField", "|xns": "Roo.form" }, { "allowBlank": true, "displayField": "addr_state", "editable": true, "emptyText": "State", "fieldLabel": "State", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "addr_state", "qtip": "Select State", "queryParam": "query[addr_state]", "selectOnFocus": true, "tpl": "
{addr_state}
", "triggerAction": "all", "typeAhead": false, "valueField": "addr_state", "width": 200, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n \n // o.params.state_country_id_country_name = _this.form.findField('addr_country').getValue();\n //if (!o.params.state_country_id_country_name.length) {\n // Roo.MessageBox.alert(\"Select Country First\");\n// return false;\n // }\n \n o.params._distinct = 'addr_state';\n o.params._columns = 'addr_state';\n o.params.limit = 999;\n // set more here\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'addr_state' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/addr.php'", "|xns": "Roo.data" }, { "*prop": "reader", "id": "addr_state", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[ 'addr_state' ]", "|xns": "Roo.data" } ] } ] }, { "allowBlank": true, "displayField": "country_name", "editable": true, "emptyText": "Country", "fieldLabel": "Country", "listWidth": 400, "loadingText": "Searching...", "minChars": 2, "name": "addr_country", "qtip": "Select Country", "queryParam": "query[country_name]", "selectOnFocus": true, "tpl": "
{country_name}
", "triggerAction": "all", "typeAhead": false, "valueField": "country_name", "width": 200, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.limit = 999;\n}\n" }, "*prop": "store", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ direction : 'ASC', field: 'country_name' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/country.php'", "|xns": "Roo.data" }, { "*prop": "reader", "id": "country_id", "root": "data", "totalProperty": "total", "xtype": "JsonReader", "|fields": "[{'name':'country_id','type':'int'},'county_name']", "|xns": "Roo.data" } ] } ] }, { "fieldLabel": "postalcode", "name": "addr_postalcode", "width": 150, "xtype": "TextField", "|xns": "Roo.form" }, { "fieldLabel": "Unique#", "name": "addr_number", "width": 150, "xtype": "TextField", "|sync": "function() {\n if (_this.form.findField('addr_id') * 1 > 0 ) {\n return;\n }\n this.setValue('C' + _this.form.findField('customer_id').getValue() + '-' + \n _this.form.findField('addr_line1').getValue()\n );\n \n}\n", "|xns": "Roo.form" }, { "fieldLabel": "notes", "name": "addr_notes", "width": 300, "xtype": "TextArea", "|xns": "Roo.form" }, { "name": "customer_id", "width": 100, "xtype": "Hidden", "|xns": "Roo.form" }, { "name": "addr_id", "width": 100, "xtype": "Hidden", "|xns": "Roo.form" } ] } ] }, { "listeners": { "click": "function (_self, e)\n{\n _this.dialog.hide();\n}" }, "*prop": "buttons[]", "text": "Cancel", "xtype": "Button", "|xns": "Roo" }, { "listeners": { "click": "function (_self, e)\n{\n // do some checks?\n \n \n \n _this.form.doAction('submit');\n\n}" }, "*prop": "buttons[]", "text": "Save", "xtype": "Button", "|xns": "Roo" } ] } ], "permname": "", "modOrder": "001" }