{ "name" : "Pman.Dialog.XtupleQuickContact", "parent" : "", "title" : "", "path" : "/home/alan/gitlive/Pman.Xtuple/Pman.Dialog.XtupleQuickContact.bjs", "permname" : "", "modOrder" : "001", "items" : [ { "modal" : true, "collapsible" : false, "title" : "Quick enter Contact / Address", "xtype" : "LayoutDialog", "width" : 500, "$ xns" : "Roo", "closable" : false, "resizable" : false, "height" : 480, "items" : [ { "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center" }, { "region" : "center", "xtype" : "ContentPanel", "$ xns" : "Roo", "items" : [ { "listeners" : { "|actioncomplete" : "function(_self,action)\n{\n if (action.type == 'setdata') {\n if (_this.data._id) { \n this.load({ method: 'GET', params: { \n _id : _this.data._id , \n _with_addr : 1\n }});\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/cntct.php'", "xtype" : "Form", "method" : "POST", "style" : "margin:10px;", "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "First Name", "xtype" : "TextField", "allowBlank" : false, "width" : 300, "$ xns" : "Roo.form", "name" : "cntct_first_name" }, { "fieldLabel" : "Last Name", "xtype" : "TextField", "width" : 300, "$ xns" : "Roo.form", "name" : "cntct_last_name" }, { "fieldLabel" : "ID Card", "xtype" : "TextField", "width" : 300, "$ xns" : "Roo.form", "name" : "cntct_id_card" }, { "xtype" : "Row", "labelWidth" : 120, "width" : 500, "$ xns" : "Roo.form", "items" : [ { "xtype" : "Column", "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Phone / Alt", "xtype" : "TextField", "$ regex" : "/^[0-9 +-]+$/", "width" : 130, "$ xns" : "Roo.form", "name" : "cntct_phone" } ] }, { "xtype" : "Column", "$ xns" : "Roo.form", "Boolean hideLabels" : true, "String/Object/Function style" : "padding-left:10px", "items" : [ { "fieldLabel" : "Phone (Alt)", "xtype" : "TextField", "$ regex" : "/^[0-9 +-]+$/", "width" : 150, "$ xns" : "Roo.form", "name" : "cntct_phone2" } ] } ] }, { "fieldLabel" : "Email", "vtype" : "email", "xtype" : "TextField", "width" : 200, "$ xns" : "Roo.form", "name" : "cntct_email" }, { "xtype" : "FieldSet", "legend" : "Address", "style" : "width:420px", "$ 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" : "cntct_addr_id_addr_line1" }, { "fieldLabel" : "Line 2", "xtype" : "TextField", "width" : 300, "$ xns" : "Roo.form", "name" : "cntct_addr_id_addr_line2" }, { "fieldLabel" : "Line 3", "xtype" : "TextField", "width" : 300, "$ xns" : "Roo.form", "name" : "cntct_addr_id_addr_line3" }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "State", "selectOnFocus" : true, "displayField" : "addr_state", "emptyText" : "State", "hiddenName" : "cntct_addr_id_addr_state", "minChars" : 2, "valueField" : "addr_state", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : true, "width" : 200, "$ xns" : "Roo.form", "name" : "cntct_addr_id_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" } ] } ] }, { "fieldLabel" : "City", "xtype" : "TextField", "width" : 300, "$ xns" : "Roo.form", "name" : "cntct_addr_id_addr_city" }, { "fieldLabel" : "Zip code", "xtype" : "TextField", "width" : 300, "$ xns" : "Roo.form", "name" : "cntct_addr_id_addr_postalcode" }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Country", "selectOnFocus" : true, "displayField" : "country_name", "emptyText" : "Country", "hiddenName" : "cntct_addr_id_addr_country", "minChars" : 2, "valueField" : "country_name", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : true, "width" : 200, "$ xns" : "Roo.form", "name" : "cntct_addr_id_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" } ] } ] } ] }, { "legend" : "Store Details (Delivery only)", "xtype" : "FieldSet", "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Name", "xtype" : "TextField", "allowBlank" : true, "readOnly" : true, "width" : 300, "$ xns" : "Roo.form", "name" : "vend_name" }, { "fieldLabel" : "Code", "xtype" : "TextField", "allowBlank" : true, "readOnly" : true, "width" : 300, "$ xns" : "Roo.form", "name" : "vendaddr_code" } ] }, { "xtype" : "Hidden", "width" : 100, "$ xns" : "Roo.form", "name" : "customer_id" }, { "xtype" : "Hidden", "width" : 100, "$ xns" : "Roo.form", "name" : "cntct_addr_id" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "cntct_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[]" } ] } ] }