{ "name" : "Pman.Dialog.XtupleAddress", "parent" : "Pman", "title" : "", "path" : "/home/alan/gitlive/Pman.Xtuple/Pman.Dialog.XtupleAddress.bjs", "permname" : "", "modOrder" : "001", "strings" : { "59716c97497eb9694541f7c3d37b1a4d" : "Country", "3c1df4260ce594cb5594696461087f2f" : "Select Country", "0dbd2559b7f2c43a6e5f0a649c4b172a" : "Edit Address", "46a2a41cc6e552044816a2d04634545d" : "State", "1243daf593fa297e07ab03bf06d925af" : "Searching...", "ea4788705e6873b424c65e91c2846b19" : "Cancel", "f2a6c498fb90ee345d997f888fce3b18" : "Delete", "c9cc8cce247e49bae79f15173ce97354" : "Save", "be2933038f93e25262400220080c111f" : "Select State" }, "items" : [ { "modal" : true, "collapsible" : false, "title" : "Edit Address", "xtype" : "LayoutDialog", "width" : 500, "$ xns" : "Roo", "closable" : false, "resizable" : false, "height" : 400, "# 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\"}", "items" : [ { "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center" }, { "region" : "center", "xtype" : "ContentPanel", "$ xns" : "Roo", "items" : [ { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "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 " }, "text" : "Delete", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ 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" }, "$ url" : "baseURL + '/Roo/addr.php'", "xtype" : "Form", "method" : "POST", "style" : "margin:10px;", "$ xns" : "Roo.form", "items" : [ { "listeners" : { "keyup" : "function (_self, e)\n{\n _this.form.findField('addr_number').sync();\n}" }, "fieldLabel" : "Line 1", "xtype" : "TextField", "allowBlank" : false, "width" : 300, "$ xns" : "Roo.form", "name" : "addr_line1" }, { "fieldLabel" : "Line 2", "xtype" : "TextField", "width" : 300, "$ xns" : "Roo.form", "name" : "addr_line2" }, { "fieldLabel" : "Line 3", "xtype" : "TextField", "width" : 300, "$ xns" : "Roo.form", "name" : "addr_line3" }, { "fieldLabel" : "City", "xtype" : "TextField", "width" : 300, "$ xns" : "Roo.form", "name" : "addr_city" }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "State", "selectOnFocus" : true, "displayField" : "addr_state", "emptyText" : "State", "minChars" : 2, "valueField" : "addr_state", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : false, "editable" : true, "width" : 200, "$ xns" : "Roo.form", "name" : "addr_state", "qtip" : "Select State", "queryParam" : "query[addr_state]", "tpl" : "
{addr_state}
", "loadingText" : "Searching...", "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" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'addr_state' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/addr.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "addr_state", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[ 'addr_state' ]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Country", "selectOnFocus" : true, "displayField" : "country_name", "emptyText" : "Country", "minChars" : 2, "valueField" : "country_name", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : false, "editable" : true, "width" : 200, "$ xns" : "Roo.form", "name" : "addr_country", "qtip" : "Select Country", "queryParam" : "query[country_name]", "tpl" : "
{country_name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.limit = 999;\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'country_name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/country.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "country_id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[{'name':'country_id','type':'int'},'county_name']", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "fieldLabel" : "postalcode", "xtype" : "TextField", "width" : 150, "$ xns" : "Roo.form", "name" : "addr_postalcode" }, { "fieldLabel" : "Unique#", "xtype" : "TextField", "width" : 150, "$ 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", "name" : "addr_number" }, { "fieldLabel" : "notes", "xtype" : "TextArea", "width" : 300, "$ xns" : "Roo.form", "name" : "addr_notes" }, { "xtype" : "Hidden", "width" : 100, "$ xns" : "Roo.form", "name" : "customer_id" }, { "xtype" : "Hidden", "width" : 100, "$ xns" : "Roo.form", "name" : "addr_id" } ] } ] }, { "listeners" : { "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}" }, "text" : "Cancel", "xtype" : "Button", "$ xns" : "Roo", "* prop" : "buttons[]" }, { "listeners" : { "click" : "function (_self, e)\n{\n // do some checks?\n \n \n \n _this.form.doAction('submit');\n\n}" }, "text" : "Save", "xtype" : "Button", "$ xns" : "Roo", "* prop" : "buttons[]" } ] } ] }