{
- "id": "roo-file-0",
- "name": "Pman.Dialog.XtupleAddress",
- "parent": "Pman",
- "title": "",
- "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleAddress.bjs",
- "items": [
+ "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" : [
{
- ".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<BR>\"+\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": "<div class=\"x-grid-cell-text x-btn button\"><b>{addr_state}</b></div>",
- "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": "<div class=\"x-grid-cell-text x-btn button\"><b>{country_name}</b> </div>",
- "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"
- }
- ]
+ "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<BR>\"+\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" : "<div class=\"x-grid-cell-text x-btn button\"><b>{addr_state}</b></div>",
+ "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" : "<div class=\"x-grid-cell-text x-btn button\"><b>{country_name}</b> </div>",
+ "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"
}
- ],
- "permname": "",
- "modOrder": "001"
+ ]
+ }
+ ]
+ },
+ {
+ "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[]"
+ }
+ ]
+ }
+ ]
}
\ No newline at end of file
// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
+Roo.namespace('Pman.Dialog');
+
Pman.Dialog.XtupleAddress = {
- dialog : false,
- callback: false,
+ _strings : {
+ '59716c97497eb9694541f7c3d37b1a4d' :"Country",
+ '3c1df4260ce594cb5594696461087f2f' :"Select Country",
+ '0dbd2559b7f2c43a6e5f0a649c4b172a' :"Edit Address",
+ '46a2a41cc6e552044816a2d04634545d' :"State",
+ '1243daf593fa297e07ab03bf06d925af' :"Searching...",
+ 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
+ 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
+ 'c9cc8cce247e49bae79f15173ce97354' :"Save",
+ 'be2933038f93e25262400220080c111f' :"Select State"
+ },
- show : function(data, cb)
- {
- if (!this.dialog) {
- this.create();
- }
+ dialog : false,
+ callback: false,
- this.callback = cb;
- this.data = data;
- this.dialog.show(this.data._el);
- if (this.form) {
- this.form.reset();
- this.form.setValues(data);
- this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
- }
+ show : function(data, cb)
+ {
+ if (!this.dialog) {
+ this.create();
+ }
+
+ this.callback = cb;
+ this.data = data;
+ this.dialog.show(this.data._el);
+ if (this.form) {
+ this.form.reset();
+ this.form.setValues(data);
+ this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
+ }
+
+ },
+ create : function()
+ {
+ var _this = this;
+ this.dialog = Roo.factory({
+ center : {
+ '|xns' : 'Roo',
+ xns : Roo,
+ xtype : 'LayoutRegion'
},
+ '|xns' : 'Roo',
+ 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 : _this._strings['0dbd2559b7f2c43a6e5f0a649c4b172a'],
+ width : 500,
+ xns : Roo,
+ xtype : 'LayoutDialog',
+ buttons : [
+ {
+ '|xns' : 'Roo',
+ text : _this._strings['ea4788705e6873b424c65e91c2846b19'],
+ xns : Roo,
+ xtype : 'Button',
+ listeners : {
+ click : function (_self, e)
+ {
+ _this.dialog.hide();
+ }
+ }
+ },
+{
+ '|xns' : 'Roo',
+ text : _this._strings['c9cc8cce247e49bae79f15173ce97354'],
+ xns : Roo,
+ xtype : 'Button',
+ listeners : {
+ click : function (_self, e)
+ {
+ // do some checks?
+
+
+
+ _this.form.doAction('submit');
+
+ }
+ }
+ }
+ ],
+ items : [
+ {
+ toolbar : {
+ '|xns' : 'Roo',
+ xns : Roo,
+ xtype : 'Toolbar',
+ items : [
+ {
+ '|xns' : 'Roo.Toolbar',
+ xns : Roo.Toolbar,
+ xtype : 'Fill'
+ },
+ {
+ '|xns' : 'Roo.Toolbar',
+ cls : 'x-btn-text-icon',
+ icon : rootURL + '/Pman/templates/images/trash.gif',
+ text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
+ xns : Roo.Toolbar,
+ xtype : 'Button',
+ listeners : {
+ click : function()
+ {
+ var id = _this.form.findField('addr_id').getValue() *1;
+ if (!id) {
+ Roo.MessageBox.alert("Error", "You can not delete this, you have not created it yet");
+ return;
+ }
+
+
+ Roo.MessageBox.confirm("Confirm", "You will only be able to delete this if it is not referenced anywhere<BR>"+
+ ", are you sure you want to try that?",
+ function (res) {
+ if(res!='yes') {
+ return;
+
+ }
+ new Pman.Request({
+ method: 'POST',
+ url: baseURL+ '/Roo/addr',
+ params : {
+ _delete : id
+ },
+ success : function() {
+ _this.callback({ addr_id : 0, addr_line1 : '' });
+ _this.dialog.hide();
+ }
+ });
+ });
+
+
+
+ }
+ }
+ }
+ ]
+
+ },
+ '|xns' : 'Roo',
+ region : 'center',
+ xns : Roo,
+ xtype : 'ContentPanel',
+ items : [
+ {
+ '|xns' : 'Roo.form',
+ method : 'POST',
+ style : 'margin:10px;',
+ url : baseURL + '/Roo/addr.php',
+ xns : Roo.form,
+ xtype : 'Form',
+ listeners : {
+ actioncomplete : function(_self,action)
+ {
+ if (action.type == 'setdata') {
+ if (_this.data.addr_id) {
+ this.load({ method: 'GET', params: { '_id' : _this.data.addr_id }});
+ }
+ return;
+ }
+ if (action.type == 'load') {
+ return;
+ }
+ if (action.type =='submit') {
+
+ _this.dialog.hide();
+
+ if (_this.callback) {
+ _this.form.setValues(action.result.data);
+ _this.callback.call(_this, _this.form.getValues());
+ }
+ _this.form.reset();
+ return;
+ }
+ },
+ rendered : function (form)
+ {
+ _this.form= form;
+ }
+ },
+ items : [
+ {
+ '|xns' : 'Roo.form',
+ allowBlank : false,
+ fieldLabel : 'Line 1',
+ name : 'addr_line1',
+ width : 300,
+ xns : Roo.form,
+ xtype : 'TextField',
+ listeners : {
+ keyup : function (_self, e)
+ {
+ _this.form.findField('addr_number').sync();
+ }
+ }
+ },
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'Line 2',
+ name : 'addr_line2',
+ width : 300,
+ xns : Roo.form,
+ xtype : 'TextField'
+ },
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'Line 3',
+ name : 'addr_line3',
+ width : 300,
+ xns : Roo.form,
+ xtype : 'TextField'
+ },
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'City',
+ name : 'addr_city',
+ width : 300,
+ xns : Roo.form,
+ xtype : 'TextField'
+ },
+ {
+ store : {
+ proxy : {
+ '|xns' : 'Roo.data',
+ method : 'GET',
+ url : baseURL + '/Roo/addr.php',
+ xns : Roo.data,
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ '|xns' : 'Roo.data',
+ fields : [ 'addr_state' ],
+ id : 'addr_state',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ xtype : 'JsonReader'
+ },
+ '|xns' : 'Roo.data',
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'addr_state' },
+ xns : Roo.data,
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+
+ // o.params.state_country_id_country_name = _this.form.findField('addr_country').getValue();
+ //if (!o.params.state_country_id_country_name.length) {
+ // Roo.MessageBox.alert("Select Country First");
+ // return false;
+ // }
+
+ o.params._distinct = 'addr_state';
+ o.params._columns = 'addr_state';
+ o.params.limit = 999;
+ // set more here
+ }
+ },
+ items : [
+
+ ]
+
+ },
+ '|xns' : 'Roo.form',
+ allowBlank : true,
+ displayField : 'addr_state',
+ editable : true,
+ emptyText : _this._strings['46a2a41cc6e552044816a2d04634545d'],
+ fieldLabel : 'State',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
+ minChars : 2,
+ name : 'addr_state',
+ qtip : _this._strings['be2933038f93e25262400220080c111f'],
+ queryParam : 'query[addr_state]',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{addr_state}</b></div>',
+ triggerAction : 'all',
+ typeAhead : false,
+ valueField : 'addr_state',
+ width : 200,
+ xns : Roo.form,
+ xtype : 'ComboBox',
+ items : [
+
+ ]
+
+ },
+ {
+ store : {
+ proxy : {
+ '|xns' : 'Roo.data',
+ method : 'GET',
+ url : baseURL + '/Roo/country.php',
+ xns : Roo.data,
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ '|xns' : 'Roo.data',
+ fields : [{'name':'country_id','type':'int'},'county_name'],
+ id : 'country_id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ xtype : 'JsonReader'
+ },
+ '|xns' : 'Roo.data',
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'country_name' },
+ xns : Roo.data,
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ o.params.limit = 999;
+ }
+ },
+ items : [
+
+ ]
+
+ },
+ '|xns' : 'Roo.form',
+ allowBlank : true,
+ displayField : 'country_name',
+ editable : true,
+ emptyText : _this._strings['59716c97497eb9694541f7c3d37b1a4d'],
+ fieldLabel : 'Country',
+ listWidth : 400,
+ loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
+ minChars : 2,
+ name : 'addr_country',
+ qtip : _this._strings['3c1df4260ce594cb5594696461087f2f'],
+ queryParam : 'query[country_name]',
+ selectOnFocus : true,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{country_name}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : false,
+ valueField : 'country_name',
+ width : 200,
+ xns : Roo.form,
+ xtype : 'ComboBox',
+ items : [
+
+ ]
+
+ },
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'postalcode',
+ name : 'addr_postalcode',
+ width : 150,
+ xns : Roo.form,
+ xtype : 'TextField'
+ },
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'Unique#',
+ name : 'addr_number',
+ sync : function() {
+ if (_this.form.findField('addr_id') * 1 > 0 ) {
+ return;
+ }
+ this.setValue('C' + _this.form.findField('customer_id').getValue() + '-' +
+ _this.form.findField('addr_line1').getValue()
+ );
+
+ },
+ width : 150,
+ xns : Roo.form,
+ xtype : 'TextField'
+ },
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'notes',
+ name : 'addr_notes',
+ width : 300,
+ xns : Roo.form,
+ xtype : 'TextArea'
+ },
+ {
+ '|xns' : 'Roo.form',
+ name : 'customer_id',
+ width : 100,
+ xns : Roo.form,
+ xtype : 'Hidden'
+ },
+ {
+ '|xns' : 'Roo.form',
+ name : 'addr_id',
+ width : 100,
+ xns : Roo.form,
+ xtype : 'Hidden'
+ }
+ ]
+
+ }
+ ]
+
+ }
+ ]
- create : function()
- {
- var _this = this;
- this.dialog = Roo.factory({
- xtype: 'LayoutDialog',
- xns: Roo,
- closable : false,
- collapsible : false,
- height : 400,
- modal : true,
- resizable : false,
- title : "Edit Address",
- width : 500,
- items : [
- {
- xtype: 'ContentPanel',
- xns: Roo,
- region : 'center',
- items : [
- {
- xtype: 'Form',
- xns: Roo.form,
- listeners : {
- actioncomplete : function(_self,action)
- {
- if (action.type == 'setdata') {
- if (_this.data.addr_id) {
- this.load({ method: 'GET', params: { '_id' : _this.data.addr_id }});
- }
- return;
- }
- if (action.type == 'load') {
- return;
- }
- if (action.type =='submit') {
-
- _this.dialog.hide();
-
- if (_this.callback) {
- _this.form.setValues(action.result.data);
- _this.callback.call(_this, _this.form.getValues());
- }
- _this.form.reset();
- return;
- }
- },
- rendered : function (form)
- {
- _this.form= form;
- }
- },
- method : 'POST',
- style : 'margin:10px;',
- url : baseURL + '/Roo/addr.php',
- items : [
- {
- xtype: 'TextField',
- xns: Roo.form,
- listeners : {
- keyup : function (_self, e)
- {
- _this.form.findField('addr_number').sync();
- }
- },
- 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: 'ComboBox',
- 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 : '<div class="x-grid-cell-text x-btn button"><b>{addr_state}</b></div>',
- triggerAction : 'all',
- typeAhead : false,
- valueField : 'addr_state',
- width : 200,
- store : {
- xtype: 'Store',
- xns: Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
-
- // o.params.state_country_id_country_name = _this.form.findField('addr_country').getValue();
- //if (!o.params.state_country_id_country_name.length) {
- // Roo.MessageBox.alert("Select Country First");
- // return false;
- // }
-
- o.params._distinct = 'addr_state';
- o.params._columns = 'addr_state';
- o.params.limit = 999;
- // set more here
- }
- },
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'addr_state' },
- proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
- method : 'GET',
- url : baseURL + '/Roo/addr.php'
- },
- reader : {
- xtype: 'JsonReader',
- xns: Roo.data,
- id : 'addr_state',
- root : 'data',
- totalProperty : 'total',
- fields : [ 'addr_state' ]
- }
- }
- },
- {
- xtype: 'ComboBox',
- xns: Roo.form,
- 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 : '<div class="x-grid-cell-text x-btn button"><b>{country_name}</b> </div>',
- triggerAction : 'all',
- typeAhead : false,
- valueField : 'country_name',
- width : 200,
- store : {
- xtype: 'Store',
- xns: Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- o.params.limit = 999;
- }
- },
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'country_name' },
- proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
- method : 'GET',
- url : baseURL + '/Roo/country.php'
- },
- reader : {
- xtype: 'JsonReader',
- xns: Roo.data,
- id : 'country_id',
- root : 'data',
- totalProperty : 'total',
- fields : [{'name':'country_id','type':'int'},'county_name']
- }
- }
- },
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'postalcode',
- name : 'addr_postalcode',
- width : 150
- },
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Unique#',
- name : 'addr_number',
- width : 150,
- sync : function() {
- if (_this.form.findField('addr_id') * 1 > 0 ) {
- return;
- }
- this.setValue('C' + _this.form.findField('customer_id').getValue() + '-' +
- _this.form.findField('addr_line1').getValue()
- );
-
- }
- },
- {
- xtype: 'TextArea',
- xns: Roo.form,
- fieldLabel : 'notes',
- name : 'addr_notes',
- width : 300
- },
- {
- xtype: 'Hidden',
- xns: Roo.form,
- name : 'customer_id',
- width : 100
- },
- {
- xtype: 'Hidden',
- xns: Roo.form,
- name : 'addr_id',
- width : 100
- }
- ]
- }
- ],
- toolbar : {
- xtype: 'Toolbar',
- xns: Roo,
- items : [
- {
- xtype: 'Fill',
- xns: Roo.Toolbar
- },
- {
- xtype: 'Button',
- xns: Roo.Toolbar,
- listeners : {
- click : function()
- {
- var id = _this.form.findField('addr_id').getValue() *1;
- if (!id) {
- Roo.MessageBox.alert("Error", "You can not delete this, you have not created it yet");
- return;
- }
-
-
- Roo.MessageBox.confirm("Confirm", "You will only be able to delete this if it is not referenced anywhere<BR>"+
- ", are you sure you want to try that?",
- function (res) {
- if(res!='yes') {
- return;
-
- }
- new Pman.Request({
- method: 'POST',
- url: baseURL+ '/Roo/addr',
- params : {
- _delete : id
- },
- success : function() {
- _this.callback({ addr_id : 0, addr_line1 : '' });
- _this.dialog.hide();
- }
- });
- });
-
-
-
- }
- },
- cls : 'x-btn-text-icon',
- text : "Delete",
- icon : rootURL + '/Pman/templates/images/trash.gif'
- }
- ]
- }
- }
- ],
- center : {
- xtype: 'LayoutRegion',
- xns: Roo
- },
- buttons : [
- {
- xtype: 'Button',
- xns: Roo,
- listeners : {
- click : function (_self, e)
- {
- _this.dialog.hide();
- }
- },
- text : "Cancel"
- },
- {
- xtype: 'Button',
- xns: Roo,
- listeners : {
- click : function (_self, e)
- {
- // do some checks?
-
-
-
- _this.form.doAction('submit');
-
- }
- },
- text : "Save"
- }
- ]
- });
- }
+ });
+ }
};