Pman.Tab.AdminLogDrill.bjs
[Pman.Admin] / Pman.Tab.AdminLogDrill.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5
6
7 // register the module first
8 Pman.on('beforeload', function()
9 {
10     Pman.register({
11         part :  ["Admin","LogDrill"],
12         modKey : '003-Pman.Tab.AdminLogDrill',
13         module : Pman.Tab.AdminLogDrill,
14         region : 'center',
15         parent : Pman.Tab.AdminLogs,
16         name : "Pman.Tab.AdminLogDrill",
17         disabled : false, 
18         permname: '' 
19     });
20 });
21
22 Pman.Tab.AdminLogDrill = new Roo.util.Observable({
23
24     panel : false,
25     disabled : false,
26     parentLayout:  false,
27
28     add : function(parentLayout, region)
29     {
30
31         var _this = this;
32         this.parentLayout = parentLayout;
33
34         this.panel = parentLayout.addxtype({
35             xtype: 'NestedLayoutPanel',
36             xns: Roo,
37             region : 'center',
38             title : "Event Drilldown",
39             layout : {
40                 xtype: 'BorderLayout',
41                 xns: Roo,
42                 items : [
43                     {
44                         xtype: 'GridPanel',
45                         xns: Roo,
46                         listeners : {
47                             activate : function() {
48                                 _this.datepanel = this;
49                                 if (_this.dategrid) {
50                                     _this.dategrid.ds.load({});
51                                 }
52                             }
53                         },
54                         background : true,
55                         fitContainer : true,
56                         fitToframe : true,
57                         region : 'west',
58                         tableName : 'Events',
59                         title : "Events",
60                         grid : {
61                             xtype: 'Grid',
62                             xns: Roo.grid,
63                             listeners : {
64                                 render : function() 
65                                 {
66                                     _this.dategrid = this; 
67                                     //_this.dialog = Pman.Dialog.FILL_IN
68                                     if (_this.panel.active) {
69                                        this.ds.load({});
70                                     }
71                                 }
72                             },
73                             autoExpandColumn : 'person_name',
74                             loadMask : true,
75                             dataSource : {
76                                 xtype: 'Store',
77                                 xns: Roo.data,
78                                 listeners : {
79                                     beforeload : function (_self, o)
80                                     {
81                                         if (! _this.dateFrom) {
82                                          return;
83                                         }
84                                         o.params = o.params || {};
85                                          
86                                      
87                                         act = _this.dateFrom.getValue();
88                                         if (act.format) {
89                                             o.params['query[from]'] = act.format('Y-m-d');
90                                         }
91                                         act = _this.dateTo.getValue();
92                                         if (act.format) {
93                                             o.params['query[to]'] = act.format('Y-m-d');
94                                         }
95                                         o.params['query[person_sum]'] = 1;
96                                         o.params._columns = 'person_id_name,person_id_email,qty';
97                                         o.params.limit = 999;
98                                      
99                                     }
100                                 },
101                                 remoteSort : true,
102                                 sortInfo : { field : 'person_name', direction: 'ASC' },
103                                 proxy : {
104                                     xtype: 'HttpProxy',
105                                     xns: Roo.data,
106                                     method : 'GET',
107                                     url : baseURL + '/Roo/Events.php'
108                                 },
109                                 reader : {
110                                     xtype: 'JsonReader',
111                                     xns: Roo.data,
112                                     totalProperty : 'total',
113                                     root : 'data',
114                                     id : 'id',
115                                     fields : [
116                                         {
117                                             'name': 'id',
118                                             'type': 'int'
119                                         },
120                                         {
121                                             'name': 'person_name',
122                                             'type': 'string'
123                                         },
124                                         {
125                                             'name': 'event_when',
126                                             'type': 'date',
127                                             'dateFormat': 'Y-m-d'
128                                         },
129                                         {
130                                             'name': 'action',
131                                             'type': 'string'
132                                         },
133                                         {
134                                             'name': 'ipaddr',
135                                             'type': 'string'
136                                         },
137                                         {
138                                             'name': 'on_id',
139                                             'type': 'int'
140                                         },
141                                         {
142                                             'name': 'on_table',
143                                             'type': 'string'
144                                         },
145                                         {
146                                             'name': 'person_id',
147                                             'type': 'int'
148                                         },
149                                         {
150                                             'name': 'remarks',
151                                             'type': 'string'
152                                         },
153                                         {
154                                             'name': 'person_id_id',
155                                             'type': 'int'
156                                         },
157                                         {
158                                             'name': 'person_id_office_id',
159                                             'type': 'int'
160                                         },
161                                         {
162                                             'name': 'person_id_name',
163                                             'type': 'string'
164                                         },
165                                         {
166                                             'name': 'person_id_phone',
167                                             'type': 'string'
168                                         },
169                                         {
170                                             'name': 'person_id_fax',
171                                             'type': 'string'
172                                         },
173                                         {
174                                             'name': 'person_id_email',
175                                             'type': 'string'
176                                         },
177                                         {
178                                             'name': 'person_id_company_id',
179                                             'type': 'int'
180                                         },
181                                         {
182                                             'name': 'person_id_role',
183                                             'type': 'string'
184                                         },
185                                         {
186                                             'name': 'person_id_active',
187                                             'type': 'int'
188                                         },
189                                         {
190                                             'name': 'person_id_remarks',
191                                             'type': 'string'
192                                         },
193                                         {
194                                             'name': 'person_id_passwd',
195                                             'type': 'string'
196                                         },
197                                         {
198                                             'name': 'person_id_owner_id',
199                                             'type': 'int'
200                                         },
201                                         {
202                                             'name': 'person_id_lang',
203                                             'type': 'string'
204                                         },
205                                         {
206                                             'name': 'person_id_no_reset_sent',
207                                             'type': 'int'
208                                         },
209                                         {
210                                             'name': 'person_id_action_type',
211                                             'type': 'string'
212                                         },
213                                         {
214                                             'name': 'person_id_project_id',
215                                             'type': 'int'
216                                         },
217                                         {
218                                             'name': 'person_id_deleted_by',
219                                             'type': 'int'
220                                         },
221                                         {
222                                             'name': 'person_id_deleted_dt',
223                                             'type': 'date'
224                                         }
225                                     ]
226                                 }
227                             },
228                             toolbar : {
229                                 xtype: 'Toolbar',
230                                 xns: Roo,
231                                 items : [
232                                     {
233                                         xtype: 'TextItem',
234                                         xns: Roo.Toolbar,
235                                         text : "Date Range"
236                                     },
237                                     {
238                                         xtype: 'DateField',
239                                         xns: Roo.form,
240                                         listeners : {
241                                             render : function (_self)
242                                             {
243                                               _this.dateTo = _self;
244                                             },
245                                             change : function (_self, newValue, oldValue)
246                                             {
247                                               _this.grid.footer.onClick('first');
248                                             }
249                                         },
250                                         format : 'Y-m-d'
251                                     },
252                                     {
253                                         xtype: 'DateField',
254                                         xns: Roo.form,
255                                         listeners : {
256                                             render : function (_self)
257                                             {
258                                               _this.dateFrom = _self;
259                                             },
260                                             change : function (_self, newValue, oldValue)
261                                             {
262                                               _this.grid.footer.onClick('first');
263                                             }
264                                         },
265                                         format : 'Y-m-d'
266                                     }
267                                 ]
268                             },
269                             colModel : [
270                                 {
271                                     xtype: 'ColumnModel',
272                                     xns: Roo.grid,
273                                     dataIndex : 'person_id_name',
274                                     header : 'Person name',
275                                     sortable : true,
276                                     width : 200,
277                                     renderer : function(v,x,r) {
278                                          return String.format('{0} &lt;<a href="mailto:{1}">{1}</a>&gt;', v, r.data.person_id_email); 
279                                      }
280                                 },
281                                 {
282                                     xtype: 'ColumnModel',
283                                     xns: Roo.grid,
284                                     dataIndex : 'qty',
285                                     header : 'Changes',
286                                     sortable : true,
287                                     width : 70,
288                                     renderer : function(v) { return String.format('{0}', v); }
289                                 }
290                             ]
291                         }
292                     },
293                     {
294                         xtype: 'GridPanel',
295                         xns: Roo,
296                         listeners : {
297                             activate : function() {
298                                 _this.tablepanel = this;
299                                 if (_this.tablegrid) {
300                                     _this.tablegrid.footer.onClick('first');
301                                 }
302                             }
303                         },
304                         background : true,
305                         fitContainer : true,
306                         fitToframe : true,
307                         region : 'center',
308                         tableName : 'Events',
309                         title : "Events",
310                         grid : {
311                             xtype: 'Grid',
312                             xns: Roo.grid,
313                             listeners : {
314                                 render : function() 
315                                 {
316                                     _this.tablegrid = this; 
317                                     //_this.dialog = Pman.Dialog.FILL_IN
318                                     if (_this.tablepanel.active) {
319                                        this.footer.onClick('first');
320                                     }
321                                 },
322                                 rowdblclick : function (_self, rowIndex, e)
323                                 {
324                                     if (!_this.dialog) return;
325                                     _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
326                                         _this.grid.footer.onClick('first');
327                                     }); 
328                                 }
329                             },
330                             autoExpandColumn : 'person_name',
331                             loadMask : true,
332                             dataSource : {
333                                 xtype: 'Store',
334                                 xns: Roo.data,
335                                 remoteSort : true,
336                                 sortInfo : { field : 'person_name', direction: 'ASC' },
337                                 proxy : {
338                                     xtype: 'HttpProxy',
339                                     xns: Roo.data,
340                                     method : 'GET',
341                                     url : baseURL + '/Roo/Events.php'
342                                 },
343                                 reader : {
344                                     xtype: 'JsonReader',
345                                     xns: Roo.data,
346                                     totalProperty : 'total',
347                                     root : 'data',
348                                     id : 'id',
349                                     fields : [
350                                         {
351                                             'name': 'id',
352                                             'type': 'int'
353                                         },
354                                         {
355                                             'name': 'person_name',
356                                             'type': 'string'
357                                         },
358                                         {
359                                             'name': 'event_when',
360                                             'type': 'date',
361                                             'dateFormat': 'Y-m-d'
362                                         },
363                                         {
364                                             'name': 'action',
365                                             'type': 'string'
366                                         },
367                                         {
368                                             'name': 'ipaddr',
369                                             'type': 'string'
370                                         },
371                                         {
372                                             'name': 'on_id',
373                                             'type': 'int'
374                                         },
375                                         {
376                                             'name': 'on_table',
377                                             'type': 'string'
378                                         },
379                                         {
380                                             'name': 'person_id',
381                                             'type': 'int'
382                                         },
383                                         {
384                                             'name': 'remarks',
385                                             'type': 'string'
386                                         },
387                                         {
388                                             'name': 'person_id_id',
389                                             'type': 'int'
390                                         },
391                                         {
392                                             'name': 'person_id_office_id',
393                                             'type': 'int'
394                                         },
395                                         {
396                                             'name': 'person_id_name',
397                                             'type': 'string'
398                                         },
399                                         {
400                                             'name': 'person_id_phone',
401                                             'type': 'string'
402                                         },
403                                         {
404                                             'name': 'person_id_fax',
405                                             'type': 'string'
406                                         },
407                                         {
408                                             'name': 'person_id_email',
409                                             'type': 'string'
410                                         },
411                                         {
412                                             'name': 'person_id_company_id',
413                                             'type': 'int'
414                                         },
415                                         {
416                                             'name': 'person_id_role',
417                                             'type': 'string'
418                                         },
419                                         {
420                                             'name': 'person_id_active',
421                                             'type': 'int'
422                                         },
423                                         {
424                                             'name': 'person_id_remarks',
425                                             'type': 'string'
426                                         },
427                                         {
428                                             'name': 'person_id_passwd',
429                                             'type': 'string'
430                                         },
431                                         {
432                                             'name': 'person_id_owner_id',
433                                             'type': 'int'
434                                         },
435                                         {
436                                             'name': 'person_id_lang',
437                                             'type': 'string'
438                                         },
439                                         {
440                                             'name': 'person_id_no_reset_sent',
441                                             'type': 'int'
442                                         },
443                                         {
444                                             'name': 'person_id_action_type',
445                                             'type': 'string'
446                                         },
447                                         {
448                                             'name': 'person_id_project_id',
449                                             'type': 'int'
450                                         },
451                                         {
452                                             'name': 'person_id_deleted_by',
453                                             'type': 'int'
454                                         },
455                                         {
456                                             'name': 'person_id_deleted_dt',
457                                             'type': 'date'
458                                         }
459                                     ]
460                                 }
461                             },
462                             footer : {
463                                 xtype: 'PagingToolbar',
464                                 xns: Roo,
465                                 pageSize : 25,
466                                 displayInfo : true,
467                                 displayMsg : "Displaying Events{0} - {1} of {2}",
468                                 emptyMsg : "No Events found"
469                             },
470                             toolbar : {
471                                 xtype: 'Toolbar',
472                                 xns: Roo,
473                                 items : [
474                                     {
475                                         xtype: 'ComboBox',
476                                         xns: Roo.form,
477                                         listeners : {
478                                             select : function (combo, record, index)
479                                             {
480                                               _this.grid.footer.onClick('first');
481                                             },
482                                             render : function (_self)
483                                             {
484                                               _this.actionSel = _self;
485                                             }
486                                         },
487                                         allowBlank : true,
488                                         displayField : 'action',
489                                         editable : false,
490                                         emptyText : "Select Action",
491                                         forceSelection : true,
492                                         listWidth : 300,
493                                         loadingText : "Searching...",
494                                         minChars : 2,
495                                         name : 'action',
496                                         pageSize : 20,
497                                         qtip : "Select Action",
498                                         queryParam : 'query[action]',
499                                         selectOnFocus : true,
500                                         tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
501                                         triggerAction : 'all',
502                                         typeAhead : true,
503                                         valueField : 'action',
504                                         width : 150,
505                                         store : {
506                                             xtype: 'Store',
507                                             xns: Roo.data,
508                                             listeners : {
509                                                 beforeload : function (_self, o)
510                                                 {
511                                                     o.params = o.params || {};
512                                                     // staff can see all logs, other companies can only see their own.
513                                                     if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
514                                                         o.params.company_id = Pman.Login.authUser.company_id;
515                                                     }
516                                                     o.params._distinct = 'action';
517                                                     o.params._columns ='action';
518                                                 }
519                                             },
520                                             remoteSort : true,
521                                             sortInfo : { field : 'action' , direction : 'ASC' },
522                                             proxy : {
523                                                 xtype: 'HttpProxy',
524                                                 xns: Roo.data,
525                                                 method : 'GET',
526                                                 url : baseURL + '/Roo/Events.php'
527                                             },
528                                             reader : {
529                                                 xtype: 'JsonReader',
530                                                 xns: Roo.data,
531                                                 totalProperty : 'total',
532                                                 root : 'data',
533                                                 id : 'id',
534                                                 fields : [
535                                                     {
536                                                         'name': 'id',
537                                                         'type': 'int'
538                                                     },
539                                                     {
540                                                         'name': 'person_name',
541                                                         'type': 'string'
542                                                     },
543                                                     {
544                                                         'name': 'event_when',
545                                                         'type': 'date',
546                                                         'dateFormat': 'Y-m-d'
547                                                     },
548                                                     {
549                                                         'name': 'action',
550                                                         'type': 'string'
551                                                     },
552                                                     {
553                                                         'name': 'ipaddr',
554                                                         'type': 'string'
555                                                     },
556                                                     {
557                                                         'name': 'on_id',
558                                                         'type': 'int'
559                                                     },
560                                                     {
561                                                         'name': 'on_table',
562                                                         'type': 'string'
563                                                     },
564                                                     {
565                                                         'name': 'person_id',
566                                                         'type': 'int'
567                                                     },
568                                                     {
569                                                         'name': 'remarks',
570                                                         'type': 'string'
571                                                     },
572                                                     {
573                                                         'name': 'person_id_id',
574                                                         'type': 'int'
575                                                     },
576                                                     {
577                                                         'name': 'person_id_office_id',
578                                                         'type': 'int'
579                                                     },
580                                                     {
581                                                         'name': 'person_id_name',
582                                                         'type': 'string'
583                                                     },
584                                                     {
585                                                         'name': 'person_id_phone',
586                                                         'type': 'string'
587                                                     },
588                                                     {
589                                                         'name': 'person_id_fax',
590                                                         'type': 'string'
591                                                     },
592                                                     {
593                                                         'name': 'person_id_email',
594                                                         'type': 'string'
595                                                     },
596                                                     {
597                                                         'name': 'person_id_company_id',
598                                                         'type': 'int'
599                                                     },
600                                                     {
601                                                         'name': 'person_id_role',
602                                                         'type': 'string'
603                                                     },
604                                                     {
605                                                         'name': 'person_id_active',
606                                                         'type': 'int'
607                                                     },
608                                                     {
609                                                         'name': 'person_id_remarks',
610                                                         'type': 'string'
611                                                     },
612                                                     {
613                                                         'name': 'person_id_passwd',
614                                                         'type': 'string'
615                                                     },
616                                                     {
617                                                         'name': 'person_id_owner_id',
618                                                         'type': 'int'
619                                                     },
620                                                     {
621                                                         'name': 'person_id_lang',
622                                                         'type': 'string'
623                                                     },
624                                                     {
625                                                         'name': 'person_id_no_reset_sent',
626                                                         'type': 'int'
627                                                     },
628                                                     {
629                                                         'name': 'person_id_action_type',
630                                                         'type': 'string'
631                                                     },
632                                                     {
633                                                         'name': 'person_id_project_id',
634                                                         'type': 'int'
635                                                     },
636                                                     {
637                                                         'name': 'person_id_deleted_by',
638                                                         'type': 'int'
639                                                     },
640                                                     {
641                                                         'name': 'person_id_deleted_dt',
642                                                         'type': 'date'
643                                                     }
644                                                 ]
645                                             }
646                                         }
647                                     },
648                                     {
649                                         xtype: 'ComboBox',
650                                         xns: Roo.form,
651                                         listeners : {
652                                             select : function (combo, record, index)
653                                             {
654                                               _this.grid.footer.onClick('first');
655                                             },
656                                             render : function (_self)
657                                             {
658                                               _this.affectSel = _self;
659                                             }
660                                         },
661                                         allowBlank : true,
662                                         displayField : 'on_table',
663                                         editable : false,
664                                         emptyText : "Select Affects",
665                                         forceSelection : true,
666                                         listWidth : 300,
667                                         loadingText : "Searching...",
668                                         minChars : 2,
669                                         name : 'on_table',
670                                         pageSize : 20,
671                                         qtip : "Select Action",
672                                         queryParam : 'query[on_table]',
673                                         selectOnFocus : true,
674                                         tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
675                                         triggerAction : 'all',
676                                         typeAhead : true,
677                                         valueField : 'action',
678                                         width : 150,
679                                         store : {
680                                             xtype: 'Store',
681                                             xns: Roo.data,
682                                             listeners : {
683                                                 beforeload : function (_self, o)
684                                                 {
685                                                     o.params = o.params || {};
686                                                     // staff can see all logs, other companies can only see their own.
687                                                     if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
688                                                         o.params.company_id = Pman.Login.authUser.company_id;
689                                                     }
690                                                     o.params._distinct = 'on_table';
691                                                     o.params._columns ='on_table';
692                                                 }
693                                             },
694                                             remoteSort : true,
695                                             sortInfo : { field : 'on_table' , direction : 'ASC' },
696                                             proxy : {
697                                                 xtype: 'HttpProxy',
698                                                 xns: Roo.data,
699                                                 method : 'GET',
700                                                 url : baseURL + '/Roo/Events.php'
701                                             },
702                                             reader : {
703                                                 xtype: 'JsonReader',
704                                                 xns: Roo.data,
705                                                 totalProperty : 'total',
706                                                 root : 'data',
707                                                 id : 'id',
708                                                 fields : [
709                                                     {
710                                                         'name': 'id',
711                                                         'type': 'int'
712                                                     },
713                                                     {
714                                                         'name': 'person_name',
715                                                         'type': 'string'
716                                                     },
717                                                     {
718                                                         'name': 'event_when',
719                                                         'type': 'date',
720                                                         'dateFormat': 'Y-m-d'
721                                                     },
722                                                     {
723                                                         'name': 'action',
724                                                         'type': 'string'
725                                                     },
726                                                     {
727                                                         'name': 'ipaddr',
728                                                         'type': 'string'
729                                                     },
730                                                     {
731                                                         'name': 'on_id',
732                                                         'type': 'int'
733                                                     },
734                                                     {
735                                                         'name': 'on_table',
736                                                         'type': 'string'
737                                                     },
738                                                     {
739                                                         'name': 'person_id',
740                                                         'type': 'int'
741                                                     },
742                                                     {
743                                                         'name': 'remarks',
744                                                         'type': 'string'
745                                                     },
746                                                     {
747                                                         'name': 'person_id_id',
748                                                         'type': 'int'
749                                                     },
750                                                     {
751                                                         'name': 'person_id_office_id',
752                                                         'type': 'int'
753                                                     },
754                                                     {
755                                                         'name': 'person_id_name',
756                                                         'type': 'string'
757                                                     },
758                                                     {
759                                                         'name': 'person_id_phone',
760                                                         'type': 'string'
761                                                     },
762                                                     {
763                                                         'name': 'person_id_fax',
764                                                         'type': 'string'
765                                                     },
766                                                     {
767                                                         'name': 'person_id_email',
768                                                         'type': 'string'
769                                                     },
770                                                     {
771                                                         'name': 'person_id_company_id',
772                                                         'type': 'int'
773                                                     },
774                                                     {
775                                                         'name': 'person_id_role',
776                                                         'type': 'string'
777                                                     },
778                                                     {
779                                                         'name': 'person_id_active',
780                                                         'type': 'int'
781                                                     },
782                                                     {
783                                                         'name': 'person_id_remarks',
784                                                         'type': 'string'
785                                                     },
786                                                     {
787                                                         'name': 'person_id_passwd',
788                                                         'type': 'string'
789                                                     },
790                                                     {
791                                                         'name': 'person_id_owner_id',
792                                                         'type': 'int'
793                                                     },
794                                                     {
795                                                         'name': 'person_id_lang',
796                                                         'type': 'string'
797                                                     },
798                                                     {
799                                                         'name': 'person_id_no_reset_sent',
800                                                         'type': 'int'
801                                                     },
802                                                     {
803                                                         'name': 'person_id_action_type',
804                                                         'type': 'string'
805                                                     },
806                                                     {
807                                                         'name': 'person_id_project_id',
808                                                         'type': 'int'
809                                                     },
810                                                     {
811                                                         'name': 'person_id_deleted_by',
812                                                         'type': 'int'
813                                                     },
814                                                     {
815                                                         'name': 'person_id_deleted_dt',
816                                                         'type': 'date'
817                                                     }
818                                                 ]
819                                             }
820                                         }
821                                     }
822                                 ]
823                             },
824                             colModel : [
825                                 {
826                                     xtype: 'ColumnModel',
827                                     xns: Roo.grid,
828                                     dataIndex : 'table_action',
829                                     header : 'Table',
830                                     width : 200,
831                                     renderer : function(v) { return String.format('{0}', v); }
832                                 },
833                                 {
834                                     xtype: 'ColumnModel',
835                                     xns: Roo.grid,
836                                     dataIndex : 'qty',
837                                     header : 'Changes',
838                                     width : 70,
839                                     renderer : function(v) { return String.format('{0}', v); }
840                                 }
841                             ]
842                         }
843                     },
844                     {
845                         xtype: 'GridPanel',
846                         xns: Roo,
847                         listeners : {
848                             activate : function() {
849                                 _this.evpanel = this;
850                                 if (_this.evgrid) {
851                                     _this.evgrid.footer.onClick('first');
852                                 }
853                             }
854                         },
855                         background : true,
856                         fitContainer : true,
857                         fitToframe : true,
858                         region : 'east',
859                         tableName : 'Events',
860                         title : "Events",
861                         grid : {
862                             xtype: 'Grid',
863                             xns: Roo.grid,
864                             listeners : {
865                                 render : function() 
866                                 {
867                                     _this.evgrid = this; 
868                                     //_this.dialog = Pman.Dialog.FILL_IN
869                                     if (_this.evpanel.active) {
870                                        this.footer.onClick('first');
871                                     }
872                                 },
873                                 rowdblclick : function (_self, rowIndex, e)
874                                 {
875                                     if (!_this.dialog) return;
876                                     _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
877                                         _this.grid.footer.onClick('first');
878                                     }); 
879                                 }
880                             },
881                             autoExpandColumn : 'person_name',
882                             loadMask : true,
883                             dataSource : {
884                                 xtype: 'Store',
885                                 xns: Roo.data,
886                                 remoteSort : true,
887                                 sortInfo : { field : 'person_name', direction: 'ASC' },
888                                 proxy : {
889                                     xtype: 'HttpProxy',
890                                     xns: Roo.data,
891                                     method : 'GET',
892                                     url : baseURL + '/Roo/Events.php'
893                                 },
894                                 reader : {
895                                     xtype: 'JsonReader',
896                                     xns: Roo.data,
897                                     totalProperty : 'total',
898                                     root : 'data',
899                                     id : 'id',
900                                     fields : [
901                                         {
902                                             'name': 'id',
903                                             'type': 'int'
904                                         },
905                                         {
906                                             'name': 'person_name',
907                                             'type': 'string'
908                                         },
909                                         {
910                                             'name': 'event_when',
911                                             'type': 'date',
912                                             'dateFormat': 'Y-m-d'
913                                         },
914                                         {
915                                             'name': 'action',
916                                             'type': 'string'
917                                         },
918                                         {
919                                             'name': 'ipaddr',
920                                             'type': 'string'
921                                         },
922                                         {
923                                             'name': 'on_id',
924                                             'type': 'int'
925                                         },
926                                         {
927                                             'name': 'on_table',
928                                             'type': 'string'
929                                         },
930                                         {
931                                             'name': 'person_id',
932                                             'type': 'int'
933                                         },
934                                         {
935                                             'name': 'remarks',
936                                             'type': 'string'
937                                         },
938                                         {
939                                             'name': 'person_id_id',
940                                             'type': 'int'
941                                         },
942                                         {
943                                             'name': 'person_id_office_id',
944                                             'type': 'int'
945                                         },
946                                         {
947                                             'name': 'person_id_name',
948                                             'type': 'string'
949                                         },
950                                         {
951                                             'name': 'person_id_phone',
952                                             'type': 'string'
953                                         },
954                                         {
955                                             'name': 'person_id_fax',
956                                             'type': 'string'
957                                         },
958                                         {
959                                             'name': 'person_id_email',
960                                             'type': 'string'
961                                         },
962                                         {
963                                             'name': 'person_id_company_id',
964                                             'type': 'int'
965                                         },
966                                         {
967                                             'name': 'person_id_role',
968                                             'type': 'string'
969                                         },
970                                         {
971                                             'name': 'person_id_active',
972                                             'type': 'int'
973                                         },
974                                         {
975                                             'name': 'person_id_remarks',
976                                             'type': 'string'
977                                         },
978                                         {
979                                             'name': 'person_id_passwd',
980                                             'type': 'string'
981                                         },
982                                         {
983                                             'name': 'person_id_owner_id',
984                                             'type': 'int'
985                                         },
986                                         {
987                                             'name': 'person_id_lang',
988                                             'type': 'string'
989                                         },
990                                         {
991                                             'name': 'person_id_no_reset_sent',
992                                             'type': 'int'
993                                         },
994                                         {
995                                             'name': 'person_id_action_type',
996                                             'type': 'string'
997                                         },
998                                         {
999                                             'name': 'person_id_project_id',
1000                                             'type': 'int'
1001                                         },
1002                                         {
1003                                             'name': 'person_id_deleted_by',
1004                                             'type': 'int'
1005                                         },
1006                                         {
1007                                             'name': 'person_id_deleted_dt',
1008                                             'type': 'date'
1009                                         }
1010                                     ]
1011                                 }
1012                             },
1013                             footer : {
1014                                 xtype: 'PagingToolbar',
1015                                 xns: Roo,
1016                                 pageSize : 25,
1017                                 displayInfo : true,
1018                                 displayMsg : "Displaying Events{0} - {1} of {2}",
1019                                 emptyMsg : "No Events found"
1020                             },
1021                             toolbar : {
1022                                 xtype: 'Toolbar',
1023                                 xns: Roo,
1024                                 items : [
1025                                     {
1026                                         xtype: 'TextItem',
1027                                         xns: Roo.Toolbar,
1028                                         text : "Show"
1029                                     }
1030                                 ]
1031                             },
1032                             colModel : [
1033                                 {
1034                                     xtype: 'ColumnModel',
1035                                     xns: Roo.grid,
1036                                     dataIndex : 'table_action',
1037                                     header : 'Table',
1038                                     width : 200,
1039                                     renderer : function(v) { return String.format('{0}', v); }
1040                                 },
1041                                 {
1042                                     xtype: 'ColumnModel',
1043                                     xns: Roo.grid,
1044                                     dataIndex : 'qty',
1045                                     header : 'Changes',
1046                                     width : 70,
1047                                     renderer : function(v) { return String.format('{0}', v); }
1048                                 }
1049                             ]
1050                         }
1051                     }
1052                 ],
1053                 west : {
1054                     xtype: 'LayoutRegion',
1055                     xns: Roo,
1056                     split : true,
1057                     width : 300
1058                 },
1059                 center : {
1060                     xtype: 'LayoutRegion',
1061                     xns: Roo
1062                 },
1063                 east : {
1064                     xtype: 'LayoutRegion',
1065                     xns: Roo,
1066                     split : true,
1067                     width : 400
1068                 }
1069             }
1070         });
1071         this.layout = this.panel.layout;
1072
1073     }
1074 });