Pman.Tab.AdminContacts.bjs
[Pman.Admin] / Pman.Tab.AdminContacts.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.AdminContacts = new Roo.XComponent({
8
9  _strings : {
10   '99b344c8ae43e3e7213862b8f35c4e51' :"Select Company",
11   '1c76cbfe21c6f44c1d1e59d54f3e4420' :"Company",
12   'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
13   '8444e81d652b084d70c71cd7d19ac0cf' :"Displaying Person{0} - {1} of {2}",
14   '13348442cc6a27032d2b4aa28b75a5d3' :"Search",
15   'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
16   '9e727fdd3aec8274f46685441900280d' :"Project",
17   '7dce122004969d56ae2e0245cb754d35' :"Edit",
18   '4110db87ce3ac86d603d03d691616b1e' :"Drag person to add or remove from group",
19   'b47a519aebda8fdb4b59bdae6eb2bff0' :"Show No Company",
20   '1243daf593fa297e07ab03bf06d925af' :"Searching...",
21   'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
22   '9675747b5ab12d05f18518761e68a533' :"Select Companies",
23   '40bed7cf9b3d4bb3a3d7a7e3eb18c5eb' :"Person",
24   'f1174ecbbc232f948717979daf04cf08' :"No Person found",
25   'ec3249f16ee5880d4c1acb752e5c925f' :"Switch to Selected User",
26   'a93806efd0cc7a149f0f03e2b9a0f862' :"Bulk Add",
27   'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
28   'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
29   '49ee3087348e8d44e1feda1917443987' :"Name",
30   'bbbabdbe1b262f75d99d62880b953be1' :"Role",
31   '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
32   'd4d25ad0a12e8d30e9d8d35230f6d1d3' :"Show Removed",
33   '9810aa2b9f44401be4bf73188ef2b67d' :"Fax"
34  },
35
36   part     :  ["Admin", "Contacts" ],
37   order    : '001-Pman.Tab.AdminContacts',
38   region   : 'center',
39   parent   : 'Pman.Tab.AdminContactsManager',
40   name     : "Pman.Tab.AdminContacts",
41   disabled : false, 
42   permname : 'Core.Person', 
43   _tree : function()
44   {
45    var _this = this;
46    var MODULE = this;
47    return {
48    grid : {
49     dataSource : {
50      proxy : {
51       '|xns' : 'Roo.data',
52       method : 'GET',
53       url : baseURL + '/Roo/Person.php',
54       xns : Roo.data,
55       xtype : 'HttpProxy'
56      },
57      reader : {
58       '|xns' : 'Roo.data',
59       fields : [
60           {
61               'name': 'id',
62               'type': 'int'
63           },
64           {
65               'name': 'office_id',
66               'type': 'int'
67           },
68           {
69               'name': 'name',
70               'type': 'string'
71           },
72           {
73               'name': 'phone',
74               'type': 'string'
75           },
76           {
77               'name': 'fax',
78               'type': 'string'
79           },
80           {
81               'name': 'email',
82               'type': 'string'
83           },
84           {
85               'name': 'company_id',
86               'type': 'int'
87           },
88           {
89               'name': 'role',
90               'type': 'string'
91           },
92           {
93               'name': 'active',
94               'type': 'int'
95           },
96           {
97               'name': 'remarks',
98               'type': 'string'
99           },
100           {
101               'name': 'passwd',
102               'type': 'string'
103           },
104           {
105               'name': 'owner_id',
106               'type': 'int'
107           },
108           {
109               'name': 'lang',
110               'type': 'string'
111           },
112           {
113               'name': 'no_reset_sent',
114               'type': 'int'
115           },
116           {
117               'name': 'action_type',
118               'type': 'string'
119           },
120           {
121               'name': 'project_id',
122               'type': 'int'
123           },
124           {
125               'name': 'office_id_id',
126               'type': 'int'
127           },
128           {
129               'name': 'office_id_company_id',
130               'type': 'int'
131           },
132           {
133               'name': 'office_id_name',
134               'type': 'string'
135           },
136           {
137               'name': 'office_id_address',
138               'type': 'string'
139           },
140           {
141               'name': 'office_id_phone',
142               'type': 'string'
143           },
144           {
145               'name': 'office_id_fax',
146               'type': 'string'
147           },
148           {
149               'name': 'office_id_email',
150               'type': 'string'
151           },
152           {
153               'name': 'office_id_role',
154               'type': 'string'
155           },
156           {
157               'name': 'company_id_code',
158               'type': 'string'
159           },
160           {
161               'name': 'company_id_name',
162               'type': 'string'
163           },
164           {
165               'name': 'company_id_remarks',
166               'type': 'string'
167           },
168           {
169               'name': 'company_id_owner_id',
170               'type': 'int'
171           },
172           {
173               'name': 'company_id_address',
174               'type': 'string'
175           },
176           {
177               'name': 'company_id_tel',
178               'type': 'string'
179           },
180           {
181               'name': 'company_id_fax',
182               'type': 'string'
183           },
184           {
185               'name': 'company_id_email',
186               'type': 'string'
187           },
188           {
189               'name': 'company_id_id',
190               'type': 'int'
191           },
192           {
193               'name': 'company_id_isOwner',
194               'type': 'int'
195           },
196           {
197               'name': 'company_id_logo_id',
198               'type': 'int'
199           },
200           {
201               'name': 'company_id_background_color',
202               'type': 'string'
203           },
204           {
205               'name': 'company_id_comptype',
206               'type': 'string'
207           },
208           {
209               'name': 'company_id_url',
210               'type': 'string'
211           },
212           {
213               'name': 'company_id_main_office_id',
214               'type': 'int'
215           },
216           {
217               'name': 'company_id_created_by',
218               'type': 'int'
219           },
220           {
221               'name': 'company_id_created_dt',
222               'type': 'date'
223           },
224           {
225               'name': 'company_id_updated_by',
226               'type': 'int'
227           },
228           {
229               'name': 'company_id_updated_dt',
230               'type': 'date'
231           },
232           {
233               'name': 'company_id_passwd',
234               'type': 'string'
235           },
236           {
237               'name': 'project_id_id',
238               'type': 'int'
239           },
240           {
241               'name': 'project_id_name',
242               'type': 'string'
243           },
244           {
245               'name': 'project_id_remarks',
246               'type': 'string'
247           },
248           {
249               'name': 'project_id_owner_id',
250               'type': 'int'
251           },
252           {
253               'name': 'project_id_code',
254               'type': 'string'
255           },
256           {
257               'name': 'project_id_active',
258               'type': 'int'
259           },
260           {
261               'name': 'project_id_type',
262               'type': 'string'
263           },
264           {
265               'name': 'project_id_client_id',
266               'type': 'int'
267           },
268           {
269               'name': 'project_id_team_id',
270               'type': 'int'
271           },
272           {
273               'name': 'project_id_file_location',
274               'type': 'string'
275           },
276           {
277               'name': 'project_id_open_date',
278               'type': 'date'
279           },
280           {
281               'name': 'project_id_open_by',
282               'type': 'int'
283           },
284           {
285               'name': 'project_id_close_date',
286               'type': 'date'
287           },
288           {
289               'name': 'project_id_countries',
290               'type': 'string'
291           },
292           {
293               'name': 'project_id_languages',
294               'type': 'string'
295           },
296           {
297               'name': 'project_id_agency_id',
298               'type': 'int'
299           },
300           {
301               'name': 'owner_id_id',
302               'type': 'int'
303           },
304           {
305               'name': 'owner_id_office_id',
306               'type': 'int'
307           },
308           {
309               'name': 'owner_id_name',
310               'type': 'string'
311           },
312           {
313               'name': 'owner_id_phone',
314               'type': 'string'
315           },
316           {
317               'name': 'owner_id_fax',
318               'type': 'string'
319           },
320           {
321               'name': 'owner_id_email',
322               'type': 'string'
323           },
324           {
325               'name': 'owner_id_company_id',
326               'type': 'int'
327           },
328           {
329               'name': 'owner_id_role',
330               'type': 'string'
331           },
332           {
333               'name': 'owner_id_active',
334               'type': 'int'
335           },
336           {
337               'name': 'owner_id_remarks',
338               'type': 'string'
339           },
340           {
341               'name': 'owner_id_passwd',
342               'type': 'string'
343           },
344           {
345               'name': 'owner_id_owner_id',
346               'type': 'int'
347           },
348           {
349               'name': 'owner_id_lang',
350               'type': 'string'
351           },
352           {
353               'name': 'owner_id_no_reset_sent',
354               'type': 'int'
355           },
356           {
357               'name': 'owner_id_action_type',
358               'type': 'string'
359           },
360           {
361               'name': 'owner_id_project_id',
362               'type': 'int'
363           }
364       ],
365       id : 'id',
366       root : 'data',
367       totalProperty : 'total',
368       xns : Roo.data,
369       xtype : 'JsonReader'
370      },
371      '|xns' : 'Roo.data',
372      remoteSort : true,
373      sortInfo : { field : 'name', direction: 'ASC' },
374      xns : Roo.data,
375      xtype : 'Store',
376      listeners : {
377       beforeload : function (_self, o)
378        {
379            if(!_this.active_company_button.pressed){
380                o.params['!company_id_comptype'] = 'OWNER';
381            }
382            
383            o.params['query[search]'] = _this.searchBox.getValue();
384            
385            if (!_this.activeButton) {return; false;}
386            
387            if (_this.companyCombo &&   _this.companyCombo.getValue()) {
388                o.params.company_id =   _this.companyCombo.getValue();
389            }
390            
391            
392            o.params.active = _this.activeButton.pressed ? 0 : 1;
393            
394            if(_this.active_company_button.pressed){
395                o.params.company_id = 0;
396            }
397            
398            var c = Pman.Tab.AdminContactsManager.layout.getRegion('west').getActivePanel();
399            
400            if (!c) { 
401                return false;
402            }
403            
404            var tms = c.grid.getSelectionModel().getSelected();
405            
406            if (!tms) {
407                return false;
408            }
409            
410            if(c.tableName == 'Groups'){
411                o.params['query[in_group]'] = tms.data.id;
412                o.params['query[type]'] = 2; // group type..
413            }else{
414                o.params['query[in_country]'] = (tms.data.country*1 == -1) ? '' : tms.data.country;
415                o.params['query[in_group]'] = 0;
416                o.params['query[type]'] = 2;
417            }
418            /*
419            if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) {
420                
421                
422                
423            }
424            
425            if(Pman.Tab.AdminCountries && Pman.Tab.AdminCountries.grid){
426                var tms = Pman.Tab.AdminCountries.grid.getSelectionModel().getSelected();
427                
428                if (!tms) {
429                    return false;
430                }
431                
432            }
433            */
434            //o.params['query[name]'] = _this.searchBox.getValue();
435          
436        },
437       update : function (_self, record, operation)
438        {
439            if (operation != 'commit') {
440                return;
441            }
442            // only used to change active status.
443            
444            new Pman.Request({
445                url : baseURL + '/Roo/Person.php',
446                method :'POST',
447                params : {
448                    id : record.data.id,
449                    active: record.data.active
450                    
451                },
452                success : function() {
453                    // do nothing
454                    
455                    _this.grid.ds.remove(record);
456                    
457                },
458                failure : function() 
459                {
460                    Roo.MessageBox.alert("Error", "saving failed", function() {
461                        _this.grid.footer.onClick('first');
462                    });
463                }
464            });
465        }
466      },
467      items : [
468
469      ]
470
471     },
472     footer : {
473      '|xns' : 'Roo',
474      displayInfo : true,
475      displayMsg : _this._strings['8444e81d652b084d70c71cd7d19ac0cf'],
476      emptyMsg : _this._strings['f1174ecbbc232f948717979daf04cf08'],
477      pageSize : 25,
478      xns : Roo,
479      xtype : 'PagingToolbar',
480      items : [
481       {
482        '|xns' : 'Roo.Toolbar',
483        text : _this._strings['4110db87ce3ac86d603d03d691616b1e'],
484        xns : Roo.Toolbar,
485        xtype : 'TextItem'
486       }
487      ]
488
489     },
490     toolbar : {
491      '|xns' : 'Roo',
492      xns : Roo,
493      xtype : 'Toolbar',
494      items : [
495       {
496        '|xns' : 'Roo.Toolbar',
497        text : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'],
498        xns : Roo.Toolbar,
499        xtype : 'TextItem'
500       },
501       {
502        '|xns' : 'Roo.form',
503        xns : Roo.form,
504        xtype : 'TextField',
505        listeners : {
506         render : function (_self)
507          {
508              _this.searchBox = _self;
509          },
510         show : function (_self,e)
511          {
512              if (e.getCharCode() != 13) {
513                  return;
514              }
515              _this.grid.footer.onClick('first');
516          },
517         specialkey : function (_self, e)
518          {
519            if (e.getKey() == 13) {
520              _this.grid.footer.onClick('first');
521            }
522          }
523        }
524       },
525       {
526        store : {
527         proxy : {
528          '|xns' : 'Roo.data',
529          method : 'GET',
530          url : baseURL + '/Roo/Companies.php',
531          xns : Roo.data,
532          xtype : 'HttpProxy'
533         },
534         reader : {
535          '|xns' : 'Roo.data',
536          fields : [{"name":"id","type":"int"},{"name":"code","type":"string"}],
537          id : 'id',
538          root : 'data',
539          totalProperty : 'total',
540          xns : Roo.data,
541          xtype : 'JsonReader'
542         },
543         '|xns' : 'Roo.data',
544         remoteSort : true,
545         sortInfo : { direction : 'ASC', field: 'name' },
546         xns : Roo.data,
547         xtype : 'Store',
548         listeners : {
549          beforeload : function (_self, o){
550               o.params = o.params || {};
551               // set more here
552           }
553         },
554         items : [
555
556         ]
557
558        },
559        '|xns' : 'Roo.form',
560        displayField : 'name',
561        editable : true,
562        emptyText : _this._strings['99b344c8ae43e3e7213862b8f35c4e51'],
563        forceSelection : true,
564        hiddenName : 'company_id',
565        listWidth : 400,
566        loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
567        minChars : 2,
568        name : 'company_name',
569        pageSize : 20,
570        qtip : _this._strings['9675747b5ab12d05f18518761e68a533'],
571        queryParam : 'query[name]',
572        selectOnFocus : true,
573        tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
574        triggerAction : 'all',
575        typeAhead : true,
576        valueField : 'id',
577        width : 150,
578        xns : Roo.form,
579        xtype : 'ComboBox',
580        listeners : {
581         render : function (_self)
582          {
583            _this.companyCombo = _self;
584          },
585         select : function (combo, record, index)
586          {
587             _this.grid.footer.onClick.defer(300,_this.grid.footer,[ 'first'] );
588          }
589        },
590        items : [
591
592        ]
593
594       },
595       {
596        '|xns' : 'Roo.Toolbar',
597        cls : 'x-btn-icon',
598        icon : rootURL + '/Pman/templates/images/search.gif',
599        xns : Roo.Toolbar,
600        xtype : 'Button',
601        listeners : {
602         click : function (_self, e)
603          {
604          _this.grid.footer.onClick('first');
605          }
606        }
607       },
608       {
609        '|xns' : 'Roo.Toolbar',
610        cls : 'x-btn-icon',
611        icon : rootURL + '/Pman/templates/images/edit-clear.gif',
612        xns : Roo.Toolbar,
613        xtype : 'Button',
614        listeners : {
615         click : function (_self, e)
616          {
617          _this.searchBox.setValue('');
618              _this.grid.footer.onClick('first');
619          }
620        }
621       },
622       {
623        '|xns' : 'Roo.Toolbar',
624        enableToggle : true,
625        text : _this._strings['d4d25ad0a12e8d30e9d8d35230f6d1d3'],
626        xns : Roo.Toolbar,
627        xtype : 'Button',
628        listeners : {
629         render : function (_self)
630          {
631            _this.activeButton = _self;
632          },
633         toggle : function (_self, pressed)
634          {
635             _this.grid.footer.onClick('first');
636             this.setText(pressed ? "Show Active" : "Show Removed");
637             
638             
639          }
640        }
641       },
642       {
643        '|xns' : 'Roo.Toolbar',
644        enableToggle : true,
645        text : _this._strings['b47a519aebda8fdb4b59bdae6eb2bff0'],
646        xns : Roo.Toolbar,
647        xtype : 'Button',
648        listeners : {
649         render : function (_self)
650          {
651            _this.active_company_button = _self;
652          },
653         toggle : function (_self, pressed)
654          {
655             _this.grid.footer.onClick('first');
656             this.setText(pressed ? "Show Company" : "Show No Company");
657             
658             
659          }
660        }
661       },
662       {
663        '|xns' : 'Roo.Toolbar',
664        text : _this._strings['ec3249f16ee5880d4c1acb752e5c925f'],
665        xns : Roo.Toolbar,
666        xtype : 'Button',
667        listeners : {
668         click : function (_self, e)
669          {
670              var s = _this.grid.getSelectionModel().getSelections();
671              if(s.length != 1){
672                  Roo.MessageBox.alert("Error", "Select a Person");
673                  return;
674              }
675              
676              new Pman.Request({
677                  url : baseURL + '/Login.php',
678                  method : 'GET',
679                  params : {
680                      'switch' : s[0].data.id
681                  },
682                  success : function (){
683                      document.location = baseURL + '?ts=' + Math.random();
684                  },
685                  failure : function (d){
686                      Roo.log(d);
687                      Roo.MessageBox.alert("Error", d);
688                  }
689              });
690          }
691        }
692       },
693       {
694        '|xns' : 'Roo.Toolbar',
695        xns : Roo.Toolbar,
696        xtype : 'Fill'
697       },
698       {
699        '|xns' : 'Roo.Toolbar',
700        cls : 'x-btn-text-icon',
701        icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
702        text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'],
703        xns : Roo.Toolbar,
704        xtype : 'Button',
705        listeners : {
706         click : function()
707          {
708              
709              _this.dialog.show( { id : 0 } , function() {
710                  _this.grid.footer.onClick('first');
711             }); 
712          }
713        }
714       },
715       {
716        '|xns' : 'Roo.Toolbar',
717        cls : 'x-btn-text-icon',
718        icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
719        text : _this._strings['a93806efd0cc7a149f0f03e2b9a0f862'],
720        xns : Roo.Toolbar,
721        xtype : 'Button',
722        listeners : {
723         click : function()
724          {
725              
726              Pman.Dialog.PersonBulkAdd.show( { id : 0 } , function() {
727                  _this.grid.footer.onClick('first');
728             }); 
729          }
730        }
731       },
732       {
733        '|xns' : 'Roo.Toolbar',
734        cls : 'x-btn-text-icon',
735        icon : Roo.rootURL + 'images/default/tree/leaf.gif',
736        text : _this._strings['7dce122004969d56ae2e0245cb754d35'],
737        xns : Roo.Toolbar,
738        xtype : 'Button',
739        listeners : {
740         click : function()
741          {
742              var s = _this.grid.getSelectionModel().getSelections();
743              if (!s.length || (s.length > 1))  {
744                  Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
745                  return;
746              }
747            
748              _this.dialog.show(s[0].data, function() {
749                  _this.grid.footer.onClick('first');
750              }); 
751              
752          }
753        }
754       },
755       {
756        '|xns' : 'Roo.Toolbar',
757        cls : 'x-btn-text-icon',
758        icon : rootURL + '/Pman/templates/images/trash.gif',
759        text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
760        xns : Roo.Toolbar,
761        xtype : 'Button',
762        listeners : {
763         click : function()
764          {
765               Pman.genericDelete(_this, 'Person'); 
766          }
767        }
768       }
769      ]
770
771     },
772     '|xns' : 'Roo.grid',
773     autoExpandColumn : 'name',
774     ddGroup : 'groupDD',
775     enableDrag : true,
776     loadMask : true,
777     xns : Roo.grid,
778     xtype : 'Grid',
779     colModel : [
780       {
781        '|xns' : 'Roo.grid',
782        dataIndex : 'project_id_code',
783        header : _this._strings['9e727fdd3aec8274f46685441900280d'],
784        hidden : true,
785        renderer : function(v,x,r) { 
786              return String.format('<span qtip="{0}">{1}</span>', 
787                            r.data.project_id_name,
788                            v);
789         },
790        sortable : true,
791        width : 75,
792        xns : Roo.grid,
793        xtype : 'ColumnModel'
794       },
795 {
796        '|xns' : 'Roo.grid',
797        dataIndex : 'company_id_comptype',
798        header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
799        renderer : function(v,x,r) {
800            if (r.data.office_id) {
801                return String.format('{0} - {1}', v, r.data.office_id_name); 
802            } 
803            return String.format('{0}', v); 
804        },
805        sortable : true,
806        width : 50,
807        xns : Roo.grid,
808        xtype : 'ColumnModel'
809       },
810 {
811        '|xns' : 'Roo.grid',
812        dataIndex : 'company_id_name',
813        header : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'],
814        renderer : function(v,x,r) {
815            if (r.data.office_id) {
816                return String.format('{0} - {1}', v, r.data.office_id_name); 
817            } 
818            return String.format('{0}', v); 
819        },
820        sortable : true,
821        width : 150,
822        xns : Roo.grid,
823        xtype : 'ColumnModel'
824       },
825 {
826        '|xns' : 'Roo.grid',
827        dataIndex : 'name',
828        header : _this._strings['49ee3087348e8d44e1feda1917443987'],
829        renderer : function(v) { return String.format('{0}', v); },
830        sortable : true,
831        width : 200,
832        xns : Roo.grid,
833        xtype : 'ColumnModel'
834       },
835 {
836        '|xns' : 'Roo.grid',
837        dataIndex : 'role',
838        header : _this._strings['bbbabdbe1b262f75d99d62880b953be1'],
839        renderer : function(v) { return String.format('{0}', v); },
840        width : 100,
841        xns : Roo.grid,
842        xtype : 'ColumnModel'
843       },
844 {
845        '|xns' : 'Roo.grid',
846        dataIndex : 'phone',
847        header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'],
848        renderer : function(v) { return String.format('{0}', v); },
849        width : 100,
850        xns : Roo.grid,
851        xtype : 'ColumnModel'
852       },
853 {
854        '|xns' : 'Roo.grid',
855        dataIndex : 'fax',
856        header : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'],
857        renderer : function(v) { return String.format('{0}', v); },
858        width : 100,
859        xns : Roo.grid,
860        xtype : 'ColumnModel'
861       },
862 {
863        '|xns' : 'Roo.grid',
864        dataIndex : 'email',
865        header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'],
866        renderer : function(v) {
867           return (v.length && v.indexOf('@') > 0 ) ? 
868                            String.format('<a href="mailto:{0}">{0}</a>',v) : v;
869         },
870        sortable : true,
871        width : 200,
872        xns : Roo.grid,
873        xtype : 'ColumnModel'
874       },
875 {
876        '|xns' : 'Roo.grid',
877        dataIndex : 'active',
878        header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
879        renderer : function(v) {  
880            var state = v> 0 ?  '-checked' : '';
881        
882            return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
883                        
884         },
885        width : 75,
886        xns : Roo.grid,
887        xtype : 'ColumnModel'
888       }
889     ],
890     listeners : {
891      cellclick : function (_self, rowIndex, columnIndex, e)
892       {
893       
894               var di = this.colModel.getDataIndex(columnIndex);
895               if (di != 'active') {
896                   return;
897               }
898                
899               var rec = _this.grid.ds.getAt(rowIndex);
900               
901               rec.set('active', rec.data.active ? 0 : 1);
902               rec.commit();
903                
904               
905       },
906      render : function() 
907       {
908           _this.grid = this; 
909           if (!_this.dialog) {
910               _this.dialog = Pman.Dialog.PersonEdit;
911               
912           }
913           //_this.dialog = Pman.Dialog.FILL_IN
914           if (_this.panel.active) {
915              this.footer.onClick('first');
916           }
917       },
918      rowdblclick : function (_self, rowIndex, e)
919       {
920           if (!_this.dialog) return;
921           _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
922               _this.grid.footer.onClick('first');
923           }); 
924       }
925     },
926     items : [
927
928     ]
929
930    },
931    '|xns' : 'Roo',
932    autoScroll : true,
933    background : true,
934    fitContainer : true,
935    fitToframe : true,
936    region : 'center',
937    tableName : 'Person',
938    title : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'],
939    xns : Roo,
940    xtype : 'GridPanel',
941    listeners : {
942     activate : function() {
943          _this.panel = this;
944          if (_this.grid) {
945              _this.grid.footer.onClick('first');
946          }
947      }
948    },
949    items : [
950
951    ]
952
953   };  }
954 });