Fix #5702 - Supplier contact details - extra fields
[Pman.Admin] / Pman.Tab.AdminGeoLocations.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Tab');
6
7 Pman.Tab.AdminGeoLocations = new Roo.XComponent({
8
9  _strings : {
10   'f2b734f9d29a7b036a5f26b229f1e918' :"Geographic Locations",
11   '59716c97497eb9694541f7c3d37b1a4d' :"Country",
12   'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
13   'fc6f97505d89fe9277965c126744647a' :"No Companies found",
14   '7dce122004969d56ae2e0245cb754d35' :"Edit",
15   '646f95b46cdc6ae59dd9f2e86bf3b598' :"Displaying Country {0} - {1} of {2}",
16   '7faaef9675ee0e8280a243a290569359' :"No. Provinces",
17   'bbf2182dd4040fabc2b5433c32fd60f4' :"Province / District",
18   '05a43538cbc752df5428fe0a71192d09' :"No. Cities",
19   '155ca6a755e25c15ad7ce45e2f638f10' :"Displaying Companies{0} - {1} of {2}",
20   '57d056ed0984166336b7879c2af3657f' :"City",
21   'c6b5d0bb9a0c3f077863fdaef9773f7c' :"Province",
22   '31311feefd4f3253ed255d109da1480b' :"No Country found",
23   '42e3bd04a7339573df51e33a0e4e8969' :"Search Province",
24   'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
25   '49ee3087348e8d44e1feda1917443987' :"Name",
26   '90fd8a29b37d805cf75af6a3809bca87' :"Search City",
27   '08b523137281088adf3cb1883c8e5627' :"Search Country",
28   '36dc0beb80c36193ac81b4f94e915e36' :"Country Name"
29  },
30
31   part     :  ["Admin", "GeoLocations" ],
32   order    : '100-Pman.Tab.AdminGeoLocations',
33   region   : 'center',
34   parent   : 'Pman.Tab.Admin',
35   name     : "unnamed module",
36   disabled : false, 
37   permname : '', 
38   _tree : function(_data)
39   {
40    var _this = this;
41    var MODULE = this;
42    return {
43    xtype : 'NestedLayoutPanel',
44    background : true,
45    region : 'center',
46    title : _this._strings['f2b734f9d29a7b036a5f26b229f1e918'] /* Geographic Locations */,
47    xns : Roo,
48    '|xns' : 'Roo',
49    layout : {
50     xtype : 'BorderLayout',
51     xns : Roo,
52     '|xns' : 'Roo',
53     center : {
54      xtype : 'LayoutRegion',
55      xns : Roo,
56      '|xns' : 'Roo'
57     },
58     east : {
59      xtype : 'LayoutRegion',
60      split : true,
61      width : 400,
62      xns : Roo,
63      '|xns' : 'Roo'
64     },
65     west : {
66      xtype : 'LayoutRegion',
67      split : true,
68      width : 400,
69      xns : Roo,
70      '|xns' : 'Roo'
71     },
72     items  : [
73      {
74       xtype : 'GridPanel',
75       fitContainer : true,
76       fitToframe : true,
77       region : 'west',
78       tableName : 'i18n',
79       title : _this._strings['59716c97497eb9694541f7c3d37b1a4d'] /* Country */,
80       listeners : {
81        activate : function() {
82             
83             _this.country_panel = this;
84             if (_this.country_grid) {
85                 _this.country_grid.footer.onClick('first');
86             }
87         }
88       },
89       xns : Roo,
90       '|xns' : 'Roo',
91       grid : {
92        xtype : 'Grid',
93        autoExpandColumn : 'lval',
94        loadMask : true,
95        listeners : {
96         render : function() 
97          {
98             _this.country_grid = this; 
99             
100              if (_this.country_panel.active) {
101                 this.footer.onClick('first');
102              }
103          }
104        },
105        xns : Roo.grid,
106        '|xns' : 'Roo.grid',
107        footer : {
108         xtype : 'PagingToolbar',
109         displayInfo : true,
110         displayMsg : _this._strings['646f95b46cdc6ae59dd9f2e86bf3b598'] /* Displaying Country {0} - {1} of {2} */,
111         emptyMsg : _this._strings['31311feefd4f3253ed255d109da1480b'] /* No Country found */,
112         pageSize : 25,
113         xns : Roo,
114         '|xns' : 'Roo'
115        },
116        toolbar : {
117         xtype : 'Toolbar',
118         xns : Roo,
119         '|xns' : 'Roo',
120         items  : [
121          {
122           xtype : 'TextField',
123           emptyText : _this._strings['08b523137281088adf3cb1883c8e5627'] /* Search Country */,
124           listeners : {
125            render : function (_self)
126             {
127                 _this.country_searchBox = _self;
128             },
129            specialkey : function (_self, e)
130             {
131                 if (e.getKey() == 13) {
132                     _this.country_grid.footer.onClick('first');
133                 }
134             }
135           },
136           xns : Roo.form,
137           '|xns' : 'Roo.form'
138          },
139          {
140           xtype : 'Button',
141           cls : 'x-btn-icon',
142           icon : rootURL + '/Pman/templates/images/search.gif',
143           listeners : {
144            click : function (_self, e)
145             {
146                 _this.country_grid.footer.onClick('first');
147             }
148           },
149           xns : Roo.Toolbar,
150           '|xns' : 'Roo.Toolbar'
151          },
152          {
153           xtype : 'Button',
154           cls : 'x-btn-icon',
155           icon : rootURL + '/Pman/templates/images/edit-clear.gif',
156           listeners : {
157            click : function (_self, e)
158             {
159                _this.country_searchBox.setValue('');
160                 _this.country_grid.footer.onClick('first');
161             }
162           },
163           xns : Roo.Toolbar,
164           '|xns' : 'Roo.Toolbar'
165          }
166         ]
167        },
168        dataSource : {
169         xtype : 'Store',
170         remoteSort : true,
171         sortInfo : { field: 'lval', direction: 'ASC' },
172         listeners : {
173          beforeload : function (_self, options)
174           {
175               options.params = options.params || {};
176               
177               options.params.ltype = 'c',
178               options.params.inlang = 'en';
179               options.is_active = 1;
180               
181               options.params['query[name]'] = _this.country_searchBox.getValue();
182               
183               options.params._with_geoip_count = 1;
184           },
185          load : function (_self, records, options)
186           {
187               _this.province_grid.footer.onClick('first');
188           }
189         },
190         xns : Roo.data,
191         '|xns' : 'Roo.data',
192         proxy : {
193          xtype : 'HttpProxy',
194          method : 'GET',
195          url : baseURL + '/Roo/i18n.php',
196          xns : Roo.data,
197          '|xns' : 'Roo.data'
198         },
199         reader : {
200          xtype : 'JsonReader',
201          fields : [
202              {
203                  'name': 'id',
204                  'type': 'int'
205              },
206              {
207                  'name': 'lkey',
208                  'type': 'string'
209              },
210              {
211                  'name': 'inlang',
212                  'type': 'string'
213              },
214              {
215                  'name': 'lval',
216                  'type': 'string'
217              },
218              {
219                  'name': 'is_active',
220                  'type': 'int'
221              },
222              {
223                  'name': 'is_prefer',
224                  'type': 'int'
225              },
226              {
227                  'name': 'no_of_division',
228                  'type': 'int'
229              },
230              {
231                  'name': 'no_of_city',
232                  'type': 'int'
233              }
234          ],
235          id : 'id',
236          root : 'data',
237          totalProperty : 'total',
238          xns : Roo.data,
239          '|xns' : 'Roo.data'
240         }
241        },
242        sm : {
243         xtype : 'RowSelectionModel',
244         singleSelect : true,
245         listeners : {
246          afterselectionchange : function (_self)
247           {
248               _this.province_grid.footer.onClick('first');
249           }
250         },
251         xns : Roo.grid,
252         '|xns' : 'Roo.grid'
253        },
254        cm : [
255         {
256          xtype : 'ColumnModel',
257          dataIndex : 'lval',
258          header : _this._strings['36dc0beb80c36193ac81b4f94e915e36'] /* Country Name */,
259          renderer : function(v) 
260          { 
261              return String.format('{0}', v ? v : ''); 
262          },
263          sortable : true,
264          width : 200,
265          xns : Roo.grid,
266          '|xns' : 'Roo.grid'
267         },
268         {
269          xtype : 'ColumnModel',
270          align : 'right',
271          dataIndex : 'no_of_division',
272          header : _this._strings['7faaef9675ee0e8280a243a290569359'] /* No. Provinces */,
273          renderer : function(v) 
274          { 
275              return String.format('{0}', v ? v : ''); 
276          },
277          sortable : true,
278          width : 100,
279          xns : Roo.grid,
280          '|xns' : 'Roo.grid'
281         },
282         {
283          xtype : 'ColumnModel',
284          align : 'right',
285          dataIndex : 'no_of_city',
286          header : _this._strings['05a43538cbc752df5428fe0a71192d09'] /* No. Cities */,
287          renderer : function(v) 
288          { 
289              return String.format('{0}', v ? v : ''); 
290          },
291          sortable : true,
292          width : 100,
293          xns : Roo.grid,
294          '|xns' : 'Roo.grid'
295         }
296        ]
297       }
298      },
299      {
300       xtype : 'GridPanel',
301       fitContainer : true,
302       fitToframe : true,
303       region : 'center',
304       tableName : 'geoip_division',
305       title : _this._strings['c6b5d0bb9a0c3f077863fdaef9773f7c'] /* Province */,
306       listeners : {
307        activate : function() {
308             _this.province_panel = this;
309             if (_this.province_grid) {
310                 _this.province_grid.footer.onClick('first');
311             }
312         }
313       },
314       xns : Roo,
315       '|xns' : 'Roo',
316       grid : {
317        xtype : 'Grid',
318        autoExpandColumn : 'name',
319        loadMask : true,
320        listeners : {
321         render : function() 
322          {
323             _this.province_grid = this; 
324             
325              if (_this.province_panel.active) {
326                 this.footer.onClick('first');
327              }
328          },
329         rowdblclick : function (_self, rowIndex, e)
330          {
331              var s =  _this.province_grid.getDataSource().getAt(rowIndex);
332              
333              Pman.Dialog.AdminGeoDivisionEdit.show({
334                  id : s.data.id
335              }, function(){
336                  _this.province_grid.footer.onClick('refresh');
337              });
338          }
339        },
340        xns : Roo.grid,
341        '|xns' : 'Roo.grid',
342        footer : {
343         xtype : 'PagingToolbar',
344         displayInfo : true,
345         displayMsg : _this._strings['155ca6a755e25c15ad7ce45e2f638f10'] /* Displaying Companies{0} - {1} of {2} */,
346         emptyMsg : _this._strings['fc6f97505d89fe9277965c126744647a'] /* No Companies found */,
347         pageSize : 25,
348         xns : Roo,
349         '|xns' : 'Roo'
350        },
351        toolbar : {
352         xtype : 'Toolbar',
353         xns : Roo,
354         '|xns' : 'Roo',
355         items  : [
356          {
357           xtype : 'TextField',
358           emptyText : _this._strings['42e3bd04a7339573df51e33a0e4e8969'] /* Search Province */,
359           listeners : {
360            render : function (_self)
361             {
362                 _this.province_searchBox = _self;
363             },
364            specialkey : function (_self, e)
365             {
366                  if (e.getKey() == 13) {
367                     _this.province_grid.footer.onClick('first');
368                  }
369             }
370           },
371           xns : Roo.form,
372           '|xns' : 'Roo.form'
373          },
374          {
375           xtype : 'Button',
376           cls : 'x-btn-icon',
377           icon : rootURL + '/Pman/templates/images/search.gif',
378           listeners : {
379            click : function (_self, e)
380             {
381                 _this.provincegrid.footer.onClick('first');
382             }
383           },
384           xns : Roo.Toolbar,
385           '|xns' : 'Roo.Toolbar'
386          },
387          {
388           xtype : 'Button',
389           cls : 'x-btn-icon',
390           icon : rootURL + '/Pman/templates/images/edit-clear.gif',
391           listeners : {
392            click : function (_self, e)
393             {
394                 _this.province_searchBox.setValue('');
395                 _this.province_grid.footer.onClick('first');
396             }
397           },
398           xns : Roo.Toolbar,
399           '|xns' : 'Roo.Toolbar'
400          },
401          {
402           xtype : 'Fill',
403           xns : Roo.Toolbar,
404           '|xns' : 'Roo.Toolbar'
405          },
406          {
407           xtype : 'Button',
408           cls : 'x-btn-text-icon',
409           icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
410           text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
411           listeners : {
412            click : function()
413             {
414                 var country = _this.country_grid.getSelectionModel().getSelected();
415                 
416                 Pman.Dialog.AdminGeoDivisionEdit.show({
417                     id : 0,
418                     country : (country) ? country.data.lkey : '',
419                     country_name : (country) ? country.data.lval : ''
420                 }, function(){
421                     _this.country_grid.footer.onClick('refresh');
422                 });
423                 
424             }
425           },
426           xns : Roo.Toolbar,
427           '|xns' : 'Roo.Toolbar'
428          },
429          {
430           xtype : 'Button',
431           cls : 'x-btn-text-icon',
432           icon : Roo.rootURL + 'images/default/tree/leaf.gif',
433           text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
434           listeners : {
435            click : function()
436             {
437                 var s = _this.province_grid.getSelectionModel().getSelected();
438                 
439                 if (!s)  {
440                     Roo.MessageBox.alert("Error", "Select a Row");
441                     return;
442                 }
443                 
444                 Pman.Dialog.AdminGeoDivisionEdit.show({
445                     id : s.data.id
446                 }, function(){
447                     _this.province_grid.footer.onClick('refresh');
448                 });
449                 
450             }
451           },
452           xns : Roo.Toolbar,
453           '|xns' : 'Roo.Toolbar'
454          },
455          {
456           xtype : 'Button',
457           cls : 'x-btn-text-icon',
458           icon : rootURL + '/Pman/templates/images/trash.gif',
459           text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
460           listeners : {
461            click : function()
462             {
463                 var s = _this.province_grid.getSelectionModel().getSelected();
464                 
465                 if (!s)  {
466                     Roo.MessageBox.alert("Error", "Select a Row");
467                     return;
468                 }
469                 
470                 Roo.MessageBox.confirm(
471                     "Confirm", 
472                     "Are you sure want to delete this division", 
473                     function(res) {
474                         if(res != 'yes') {
475                             return;
476                         }
477                         new Pman.Request({
478                             method : 'POST',
479                             url : baseURL + '/Roo/geoip_division',
480                             params : {
481                                 _delete  : s.data.id
482                             },
483                             success : function() {
484                                 _this.country_grid.footer.onClick('refresh');
485                             }
486                         });
487                     }
488                 );
489             }
490           },
491           xns : Roo.Toolbar,
492           '|xns' : 'Roo.Toolbar'
493          }
494         ]
495        },
496        dataSource : {
497         xtype : 'Store',
498         remoteSort : true,
499         sortInfo : { field: 'name', direction: 'ASC' },
500         listeners : {
501          beforeload : function (_self, options)
502           {
503               options.params = options.params || {};
504               
505               var country = _this.country_grid.getSelectionModel().getSelected();
506               
507               if(!country) {
508                   this.removeAll();
509                   return false;
510               }
511               
512               options.params.country = country.data.lkey;
513               
514               options.params['query[name]'] = _this.province_searchBox.getValue();
515               
516               options.params._with_geoip_count = 1;
517           },
518          load : function (_self, records, options)
519           {
520               _this.city_grid.footer.onClick('first');
521           }
522         },
523         xns : Roo.data,
524         '|xns' : 'Roo.data',
525         proxy : {
526          xtype : 'HttpProxy',
527          method : 'GET',
528          url : baseURL + '/Roo/geoip_division.php',
529          xns : Roo.data,
530          '|xns' : 'Roo.data'
531         },
532         reader : {
533          xtype : 'JsonReader',
534          fields : [
535              {
536                  'name': 'id',
537                  'type': 'int'
538              },
539              {
540                  'name': 'code',
541                  'type': 'string'
542              },
543              {
544                  'name': 'name',
545                  'type': 'string'
546              },
547              {
548                  'name': 'country',
549                  'type': 'string'
550              },
551              {
552                  'name': 'country_name',
553                  'type': 'string'
554              },
555              {
556                  'name': 'no_of_city',
557                  'type': 'string'
558              }
559          ],
560          id : 'id',
561          root : 'data',
562          totalProperty : 'total',
563          xns : Roo.data,
564          '|xns' : 'Roo.data'
565         }
566        },
567        sm : {
568         xtype : 'RowSelectionModel',
569         singleSelect : true,
570         listeners : {
571          afterselectionchange : function (_self)
572           {
573               _this.city_grid.footer.onClick('first');
574           }
575         },
576         xns : Roo.grid,
577         '|xns' : 'Roo.grid'
578        },
579        cm : [
580         {
581          xtype : 'ColumnModel',
582          dataIndex : 'name',
583          header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
584          renderer : function(v) 
585          { 
586              return String.format('{0}', v ? v : ''); 
587          },
588          sortable : true,
589          width : 200,
590          xns : Roo.grid,
591          '|xns' : 'Roo.grid'
592         },
593         {
594          xtype : 'ColumnModel',
595          align : 'right',
596          dataIndex : 'no_of_city',
597          header : _this._strings['05a43538cbc752df5428fe0a71192d09'] /* No. Cities */,
598          renderer : function(v) 
599          { 
600              return String.format('{0}', v ? v : ''); 
601          },
602          sortable : true,
603          width : 100,
604          xns : Roo.grid,
605          '|xns' : 'Roo.grid'
606         }
607        ]
608       }
609      },
610      {
611       xtype : 'GridPanel',
612       fitContainer : true,
613       fitToframe : true,
614       region : 'east',
615       tableName : 'geoip_city',
616       title : _this._strings['57d056ed0984166336b7879c2af3657f'] /* City */,
617       listeners : {
618        activate : function() {
619             
620             _this.city_panel = this;
621             if (_this.city_grid) {
622                 _this.city_grid.footer.onClick('first');
623             }
624         }
625       },
626       xns : Roo,
627       '|xns' : 'Roo',
628       grid : {
629        xtype : 'Grid',
630        autoExpandColumn : 'name',
631        loadMask : true,
632        listeners : {
633         render : function() 
634          {
635             _this.city_grid = this; 
636             
637              if (_this.city_panel.active) {
638                 this.footer.onClick('first');
639              }
640          },
641         rowdblclick : function (_self, rowIndex, e)
642          {
643              var s =  _this.city_grid.getDataSource().getAt(rowIndex);
644              
645              Pman.Dialog.AdminGeoCityEdit.show({
646                  id : s.data.id
647              }, function(){
648                  _this.city_grid.footer.onClick('refresh');
649              });
650              
651          }
652        },
653        xns : Roo.grid,
654        '|xns' : 'Roo.grid',
655        footer : {
656         xtype : 'PagingToolbar',
657         displayInfo : true,
658         displayMsg : _this._strings['646f95b46cdc6ae59dd9f2e86bf3b598'] /* Displaying Country {0} - {1} of {2} */,
659         emptyMsg : _this._strings['31311feefd4f3253ed255d109da1480b'] /* No Country found */,
660         pageSize : 25,
661         xns : Roo,
662         '|xns' : 'Roo'
663        },
664        toolbar : {
665         xtype : 'Toolbar',
666         xns : Roo,
667         '|xns' : 'Roo',
668         items  : [
669          {
670           xtype : 'TextField',
671           emptyText : _this._strings['90fd8a29b37d805cf75af6a3809bca87'] /* Search City */,
672           listeners : {
673            render : function (_self)
674             {
675                 _this.city_searchBox = _self;
676             },
677            specialkey : function (_self, e)
678             {
679                 if (e.getKey() == 13) {
680                     _this.city_grid.footer.onClick('first');
681                 }
682             }
683           },
684           xns : Roo.form,
685           '|xns' : 'Roo.form'
686          },
687          {
688           xtype : 'Button',
689           cls : 'x-btn-icon',
690           icon : rootURL + '/Pman/templates/images/search.gif',
691           listeners : {
692            click : function (_self, e)
693             {
694                 _this.country_grid.footer.onClick('first');
695             }
696           },
697           xns : Roo.Toolbar,
698           '|xns' : 'Roo.Toolbar'
699          },
700          {
701           xtype : 'Button',
702           cls : 'x-btn-icon',
703           icon : rootURL + '/Pman/templates/images/edit-clear.gif',
704           listeners : {
705            click : function (_self, e)
706             {
707                _this.country_searchBox.setValue('');
708                 _this.country_grid.footer.onClick('first');
709             }
710           },
711           xns : Roo.Toolbar,
712           '|xns' : 'Roo.Toolbar'
713          },
714          {
715           xtype : 'Fill',
716           xns : Roo.Toolbar,
717           '|xns' : 'Roo.Toolbar'
718          },
719          {
720           xtype : 'Button',
721           cls : 'x-btn-text-icon',
722           icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
723           text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
724           listeners : {
725            click : function()
726             {
727                 var country = _this.country_grid.getSelectionModel().getSelected();
728                 
729                 var province = _this.province_grid.getSelectionModel().getSelected();
730                 
731                 Pman.Dialog.AdminGeoCityEdit.show({
732                     id : 0,
733                     country : (country) ? country.data.lkey : '',
734                     country_name : (country) ? country.data.lval : '',
735                     division_id : (province) ? province.data.id : '',
736                     division_id_name : (province) ? province.data.name : ''
737                 }, function(){
738                     _this.country_grid.footer.onClick('refresh');
739                 });
740                 
741             }
742           },
743           xns : Roo.Toolbar,
744           '|xns' : 'Roo.Toolbar'
745          },
746          {
747           xtype : 'Button',
748           cls : 'x-btn-text-icon',
749           icon : Roo.rootURL + 'images/default/tree/leaf.gif',
750           text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
751           listeners : {
752            click : function()
753             {
754                 var s = _this.city_grid.getSelectionModel().getSelections();
755                 
756                 if (!s.length || s.length > 1)  {
757                     Roo.MessageBox.alert("Error", "Select a single city");
758                     return;
759                 }
760                 
761                 Pman.Dialog.AdminGeoCityEdit.show({
762                     id : s[0].data.id
763                 }, function(){
764                     _this.city_grid.footer.onClick('refresh');
765                 });
766                 
767             }
768           },
769           xns : Roo.Toolbar,
770           '|xns' : 'Roo.Toolbar'
771          },
772          {
773           xtype : 'Button',
774           cls : 'x-btn-text-icon',
775           icon : rootURL + '/Pman/templates/images/trash.gif',
776           text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
777           listeners : {
778            click : function()
779             {
780                 var s = _this.city_grid.getSelectionModel().getSelections();
781                 
782                 if (!s.length)  {
783                     Roo.MessageBox.alert("Error", "Select city to delete");
784                     return;
785                 }
786                 
787                 var ids = [];
788                 
789                 Roo.each(s, function(v, k){
790                     ids.push(v.data.id);
791                 });
792                 
793                 Roo.MessageBox.confirm(
794                     "Confirm", 
795                     "Are you sure want to delete the selected city", 
796                     function(res) {
797                         if(res != 'yes') {
798                             return;
799                         }
800                         new Pman.Request({
801                             method : 'POST',
802                             url : baseURL + '/Roo/geoip_city',
803                             params : {
804                                 _delete  : ids.join(',')
805                             },
806                             success : function() {
807                                 _this.country_grid.footer.onClick('refresh');
808                             }
809                         });
810                     }
811                 );
812             }
813           },
814           xns : Roo.Toolbar,
815           '|xns' : 'Roo.Toolbar'
816          }
817         ]
818        },
819        dataSource : {
820         xtype : 'Store',
821         remoteSort : true,
822         sortInfo : { field: 'name', direction: 'ASC' },
823         listeners : {
824          beforeload : function (_self, options)
825           {
826               options.params = options.params || {};
827               
828               var country = _this.country_grid.getSelectionModel().getSelected();
829               
830               if(!country) {
831                   this.removeAll();
832                   return false;
833               }
834               
835               options.params.country = country.data.lkey;
836               
837               var province = _this.province_grid.getSelectionModel().getSelected();
838               
839               if(province) {
840                   options.params.division_id = province.data.id
841               }
842               
843               options.params['query[name]'] = _this.city_searchBox.getValue();
844           }
845         },
846         xns : Roo.data,
847         '|xns' : 'Roo.data',
848         proxy : {
849          xtype : 'HttpProxy',
850          method : 'GET',
851          url : baseURL + '/Roo/geoip_city.php',
852          xns : Roo.data,
853          '|xns' : 'Roo.data'
854         },
855         reader : {
856          xtype : 'JsonReader',
857          fields : [
858              {
859                  'name': 'id',
860                  'type': 'int'
861              },
862              {
863                  'name': 'name',
864                  'type': 'string'
865              },
866              {
867                  'name': 'country',
868                  'type': 'string'
869              },
870              {
871                  'name': 'country_name',
872                  'type': 'string'
873              },
874              {
875                  'name': 'division_id',
876                  'type': 'int'
877              },
878              {
879                  'name': 'division_id_name',
880                  'type': 'string'
881              },
882              {
883                  'name': 'postal_code',
884                  'type': 'string'
885              },
886              {
887                  'name': 'time_zone',
888                  'type': 'string'
889              }
890          ],
891          id : 'id',
892          root : 'data',
893          totalProperty : 'total',
894          xns : Roo.data,
895          '|xns' : 'Roo.data'
896         }
897        },
898        cm : [
899         {
900          xtype : 'ColumnModel',
901          dataIndex : 'name',
902          header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
903          renderer : function(v) 
904          { 
905              return String.format('{0}', v ? v : ''); 
906          },
907          sortable : true,
908          width : 200,
909          xns : Roo.grid,
910          '|xns' : 'Roo.grid'
911         },
912         {
913          xtype : 'ColumnModel',
914          dataIndex : 'division_id_name',
915          header : _this._strings['bbf2182dd4040fabc2b5433c32fd60f4'] /* Province / District */,
916          renderer : function(v) 
917          { 
918              return String.format('{0}', v ? v : ''); 
919          },
920          sortable : true,
921          width : 150,
922          xns : Roo.grid,
923          '|xns' : 'Roo.grid'
924         }
925        ]
926       }
927      }
928     ]
929    }
930   };  }
931 });