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