1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.XtupleQuickContact = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
38 title : "Quick enter Contact / Address",
42 xtype: 'ContentPanel',
50 actioncomplete : function(_self,action)
52 if (action.type == 'setdata') {
54 this.load({ method: 'GET', params: {
55 _id : _this.data._id ,
61 if (action.type == 'load') {
64 if (action.type =='submit') {
69 _this.form.setValues(action.result.data);
70 _this.callback.call(_this, _this.form.getValues());
76 rendered : function (form)
82 style : 'margin:10px;',
83 url : baseURL + '/Roo/cntct.php',
89 fieldLabel : 'First Name',
90 name : 'cntct_first_name',
96 fieldLabel : 'Last Name',
97 name : 'cntct_last_name',
103 fieldLabel : 'Phone',
104 name : 'cntct_phone',
106 regex : /^[0-9 +-]+$/
111 fieldLabel : 'Email',
112 name : 'cntct_email',
120 style : 'width:420px',
126 keyup : function (_self, e)
128 _this.form.findField('addr_number').sync();
132 fieldLabel : 'Line 1',
133 name : 'cntct_addr_id_addr_line1',
139 fieldLabel : 'Line 2',
140 name : 'cntct_addr_id_addr_line2',
146 fieldLabel : 'Line 3',
147 name : 'cntct_addr_id_addr_line3',
154 displayField : 'addr_state',
157 fieldLabel : 'State',
158 hiddenName : 'cntct_addr_id_addr_state',
160 loadingText : "Searching...",
162 name : 'cntct_addr_id_addr_state',
163 qtip : "Select State",
164 queryParam : 'query[addr_state]',
165 selectOnFocus : true,
166 tpl : '<div class="x-grid-cell-text x-btn button"><b>{addr_state}</b> </div>',
167 triggerAction : 'all',
169 valueField : 'addr_state',
175 beforeload : function (_self, o){
176 o.params = o.params || {};
178 // o.params.state_country_id_country_name = _this.form.findField('addr_country').getValue();
179 //if (!o.params.state_country_id_country_name.length) {
180 // Roo.MessageBox.alert("Select Country First");
184 o.params._distinct = 'addr_state';
185 o.params._columns = 'addr_state';
186 o.params.limit = 999;
191 sortInfo : { direction : 'ASC', field: 'addr_state' },
196 url : baseURL + '/Roo/addr.php'
203 totalProperty : 'total',
204 fields : [ "addr_state"]
212 name : 'cntct_addr_id_addr_city',
218 fieldLabel : 'Zip code',
219 name : 'cntct_addr_id_addr_postalcode',
226 displayField : 'country_name',
228 emptyText : "Country",
229 fieldLabel : 'Country',
230 hiddenName : 'cntct_addr_id_addr_country',
232 loadingText : "Searching...",
234 name : 'cntct_addr_id_addr_country',
235 qtip : "Select Country",
236 queryParam : 'query[country_name]',
237 selectOnFocus : true,
238 tpl : '<div class="x-grid-cell-text x-btn button"><b>{country_name}</b> </div>',
239 triggerAction : 'all',
241 valueField : 'country_name',
247 beforeload : function (_self, o){
248 o.params = o.params || {};
250 o.params.limit = 999;
254 sortInfo : { direction : 'ASC', field: 'country_name' },
259 url : baseURL + '/Roo/country.php'
266 totalProperty : 'total',
267 fields : [{"name":"country_id","type":"int"},"county_name"]
277 fieldLabel : 'Store (Delivery)',
278 name : 'cntct_addr_id_addr_line1',
285 name : 'customer_id',
291 name : 'cntct_addr_id',
305 xtype: 'LayoutRegion',
313 click : function (_self, e)
324 click : function (_self, e)
330 _this.form.doAction("submit");