Pman.Tab.AdminEnum.bjs
[Pman.Admin] / Pman.Tab.AdminEnum.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Tab');
6
7 Pman.Tab.AdminEnum = new Roo.XComponent({
8
9  _strings : {
10   '2df80d5febcde0c10a66818488622b7c' :"Pulldown Options",
11   'd1228f5476d15142b1358ae4b5fa2454' :"Order #",
12   'fdff10eac021dfbb69e9c38204237fdc' :"Add new pulldown list",
13   '1206eb8aea05be4625371c9c12818785' :"Pulldown",
14   '801ab24683a4a8c433c6eb40c48bcd9d' :"Download",
15   '7af54708cf5a4286cf0cfa58ff5148a8' :"Internal #",
16   'be53a0541a6d36f6ecb879fa2c584b08' :"Image",
17   '1a87a3d29199e3435b8fb314624c008f' :"Merge Option",
18   'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
19   '510bc6e58593b2b8002c9fe0c21f3fde' :"Displaying core_enum{0} - {1} of {2}",
20   '1ba4d808fc7b27a7f60ce2ff75a8af3a' :"No core_enum found",
21   'c550aeed26e71a81a88360c1889245ab' :"Upload Values",
22   'd9ec74f5aa29ceef6bf7b45f7fec5d0f' :"Add Value",
23   'b9c49611cfda3259a2b837b39489e650' :"Add Image",
24   '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
25   'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
26   '49ee3087348e8d44e1feda1917443987' :"Name",
27   '7215ee9c7d9dc229d2921a40e899ec5f' :" "
28  },
29
30   part     :  ["Admin", "Enum" ],
31   order    : '500-Pman.Tab.AdminEnum',
32   region   : 'center',
33   parent   : 'Pman.Tab.Admin',
34   name     : "Pman.Tab.AdminEnum",
35   disabled : false, 
36   permname : '', 
37   _tree : function()
38   {
39    var _this = this;
40    var MODULE = this;
41    return {
42    layout : {
43     west : {
44      '|xns' : 'Roo',
45      split : true,
46      width : 200,
47      xns : Roo,
48      xtype : 'LayoutRegion'
49     },
50     center : {
51      '|xns' : 'Roo',
52      xns : Roo,
53      xtype : 'LayoutRegion'
54     },
55     '|xns' : 'Roo',
56     xns : Roo,
57     xtype : 'BorderLayout',
58     items : [
59      {
60       grid : {
61        dataSource : {
62         proxy : {
63          '|xns' : 'Roo.data',
64          method : 'GET',
65          url : baseURL + '/Roo/core_enum.php',
66          xns : Roo.data,
67          xtype : 'HttpProxy'
68         },
69         reader : {
70          '|xns' : 'Roo.data',
71          fields : [
72              {
73                  'name': 'id',
74                  'type': 'int'
75              },
76              {
77                  'name': 'etype',
78                  'type': 'string'
79              },
80              {
81                  'name': 'name',
82                  'type': 'string'
83              },
84              {
85                  'name': 'active',
86                  'type': 'int'
87              },
88              {
89                  'name': 'seqid',
90                  'type': 'int'
91              }
92          ],
93          id : 'id',
94          root : 'data',
95          totalProperty : 'total',
96          xns : Roo.data,
97          xtype : 'JsonReader'
98         },
99         '|xns' : 'Roo.data',
100         remoteSort : true,
101         sortInfo : { field : 'etype', direction: 'ASC' },
102         xns : Roo.data,
103         xtype : 'Store',
104         listeners : {
105          beforeload : function (_self, o)
106           {
107               o.params['query[empty_etype]'] = 1; 
108             
109           },
110          update : function (_self, record, operation)
111           {
112               if (operation != Roo.data.Record.COMMIT) {
113                   return;
114               }
115               // got commit..
116               new Pman.Request({
117                   url : baseURL + '/Roo/Core_enum.php',
118                   method : 'POST',
119                   params : {
120                       id : record.data.id,
121                       etype : _this.grid.ds.getById(record.id).data.etype,
122                       name : record.data.name,
123                       active : record.data.active,
124                       seqid : record.data.seqid,
125                       display_name : record.data.display_name
126                   }, 
127                   success : function(res) {
128                       //Roo.log(data);
129                       // update the ID if it's not set..
130                       if (record.data.id * 1 < 1) {
131                           record.set('id', res.data.id);
132                       }
133                   }
134               });
135               
136           }
137         },
138         items : [
139
140         ]
141
142        },
143        sm : {
144         '|xns' : 'Roo.grid',
145         xns : Roo.grid,
146         xtype : 'CellSelectionModel',
147         listeners : {
148          selectionchange : function (_self, selection)
149           {
150               _this.grid.footer.onClick('first');
151           }
152         }
153        },
154        footer : {
155         '|xns' : 'Roo',
156         displayInfo : false,
157         displayMsg : _this._strings['7215ee9c7d9dc229d2921a40e899ec5f'],
158         emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'],
159         pageSize : 100,
160         xns : Roo,
161         xtype : 'PagingToolbar'
162        },
163        toolbar : {
164         '|xns' : 'Roo',
165         xns : Roo,
166         xtype : 'Toolbar',
167         items : [
168          {
169           '|xns' : 'Roo.Toolbar',
170           cls : 'x-btn-text-icon',
171           icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
172           text : _this._strings['fdff10eac021dfbb69e9c38204237fdc'],
173           xns : Roo.Toolbar,
174           xtype : 'Button',
175           listeners : {
176            click : function()
177             {
178                 
179                 var data = {
180                     active:1,
181                     display_name:'',
182                     etype:'',
183                     name:''
184                 };
185                 Pman.Dialog.AdminEnumType.show(data,function(){
186                     
187                     _this.egrid.footer.onClick('first');
188                 });
189                      
190                      
191             
192             }
193           }
194          }
195         ]
196
197        },
198        '|xns' : 'Roo.grid',
199        autoExpandColumn : 'display_name',
200        clicksToEdit : 1,
201        loadMask : true,
202        xns : Roo.grid,
203        xtype : 'EditorGrid',
204        colModel : [
205          {
206           '|xns' : 'Roo.grid',
207           dataIndex : 'display_name',
208           header : _this._strings['1206eb8aea05be4625371c9c12818785'],
209           renderer : function(v,x,r) { 
210           
211           
212               return String.format('<span qtip="{1}">{0}</span>', (''+v).length ? v : r.data.name, r.data.name); 
213           },
214           width : 200,
215           xns : Roo.grid,
216           xtype : 'ColumnModel'
217          },
218 {
219           '|xns' : 'Roo.grid',
220           dataIndex : 'active',
221           header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
222           renderer : function(v) {  
223               var state = v> 0 ?  '-checked' : '';
224           
225               return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
226                           
227            },
228           width : 50,
229           xns : Roo.grid,
230           xtype : 'ColumnModel'
231          }
232        ],
233        listeners : {
234         afteredit : function (e)
235          {
236             e.record.commit();     
237          },
238         beforeedit : function (e)
239          {
240              if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
241                  return false;
242              }
243          },
244         cellclick : function (_self, rowIndex, columnIndex, e)
245          {
246          
247                  var di = this.colModel.getDataIndex(columnIndex);
248                  if (di != 'active') {
249                      return;
250                  }
251                   
252                  var rec = _this.grid.ds.getAt(rowIndex);
253                  
254                  rec.set('active', rec.data.active ? 0 : 1);
255                  rec.commit();
256                   
257                  
258          },
259         celldblclick : function (_self, rowIndex, columnIndex, e)
260          {
261              var rec = _this.egrid.ds.getAt(rowIndex);
262              Pman.Dialog.AdminEnumType.show(rec.data,function(){
263                  
264                  _this.egrid.footer.onClick('first');
265              });
266          },
267         render : function() 
268          {
269              _this.egrid = this; 
270              //_this.dialog = Pman.Dialog.FILL_IN
271              if (_this.epanel.active) {
272                 this.footer.onClick('first');
273              }
274          }
275        },
276        items : [
277
278        ]
279
280       },
281       '|xns' : 'Roo',
282       background : false,
283       region : 'west',
284       tableName : 'core_enum',
285       title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
286       xns : Roo,
287       xtype : 'GridPanel',
288       listeners : {
289        activate : function() {
290             _this.epanel = this;
291             //if (_this.egrid) {
292             //    _this.egrid.footer.onClick('first');
293             //}
294         }
295       },
296       items : [
297
298       ]
299
300      },
301      {
302       grid : {
303        dataSource : {
304         proxy : {
305          '|xns' : 'Roo.data',
306          method : 'GET',
307          url : baseURL + '/Roo/core_enum.php',
308          xns : Roo.data,
309          xtype : 'HttpProxy'
310         },
311         reader : {
312          '|xns' : 'Roo.data',
313          fields : [
314              {
315                  'name': 'id',
316                  'type': 'int'
317              },
318              {
319                  'name': 'etype',
320                  'type': 'string'
321              },
322              {
323                  'name': 'name',
324                  'type': 'string'
325              },
326              {
327                  'name': 'active',
328                  'type': 'int'
329              },
330              {
331                  'name': 'seqid',
332                  'type': 'int'
333              }
334          ],
335          id : 'id',
336          root : 'data',
337          totalProperty : 'total',
338          xns : Roo.data,
339          xtype : 'JsonReader'
340         },
341         '|xns' : 'Roo.data',
342         remoteSort : true,
343         sortInfo : { field : 'etype', direction: 'ASC' },
344         xns : Roo.data,
345         xtype : 'Store',
346         listeners : {
347          beforeload : function (_self, options)
348           {
349           
350               var s =     _this.egrid.getSelectionModel().getSelectedCell();
351               
352           
353               if (!s) {
354                   return false;
355               }
356               var d = _this.egrid.dataSource.getAt(s[0]);
357               
358               options.params.etype = d.data.name;
359               options.params['query[search]'] = _this.searchBox.getValue();
360               if (!options.params.etype.length) {
361                   return false;
362               }
363           },
364          update : function (_self, record, operation)
365           {
366               if (operation != Roo.data.Record.COMMIT) {
367                   return;
368               }
369               // got commit..
370               new Pman.Request({
371                   url : baseURL + '/Roo/Core_enum.php',
372                   method : 'POST',
373                   params : {
374                       id : record.data.id,
375                       etype : _this.grid.ds.getById(record.id).data.etype,
376                       name : record.data.name,
377                       active : record.data.active,
378                       seqid : record.data.seqid,
379                       display_name : record.data.display_name
380                   }, 
381                   success : function(res) {
382                       //Roo.log(data);
383                       // update the ID if it's not set..
384                       if (record.data.id * 1 < 1) {
385                           record.set('id', res.data.id);
386                       }
387                   }
388               });
389               
390           }
391         },
392         items : [
393
394         ]
395
396        },
397        footer : {
398         '|xns' : 'Roo',
399         displayInfo : true,
400         displayMsg : _this._strings['510bc6e58593b2b8002c9fe0c21f3fde'],
401         emptyMsg : _this._strings['1ba4d808fc7b27a7f60ce2ff75a8af3a'],
402         pageSize : 25,
403         xns : Roo,
404         xtype : 'PagingToolbar',
405         items : [
406          {
407           '|xns' : 'Roo.Toolbar',
408           text : _this._strings['801ab24683a4a8c433c6eb40c48bcd9d'],
409           xns : Roo.Toolbar,
410           xtype : 'Button',
411           listeners : {
412            click : function (_self, e)
413             {
414                 new Pman.Download({
415                     grid : _this.grid
416                 });
417                 Roo.MessageBox.alert("Downloading", "File is downloading");
418             }
419           }
420          },
421          {
422           '|xns' : 'Roo.Toolbar',
423           text : _this._strings['c550aeed26e71a81a88360c1889245ab'],
424           xns : Roo.Toolbar,
425           xtype : 'Button',
426           listeners : {
427            click : function (_self, e)
428             {
429             
430               var s =     _this.egrid.getSelectionModel().getSelectedCell();
431                 
432             
433                 if (!s) {
434                     Roo.MessageBox.alert("Error", "Select a pulldown");
435                 }
436                 
437                 var d = _this.egrid.dataSource.getAt(s[0]);
438              
439             
440                 var etype = d.data.name;
441                 
442                 if(!etype.length){
443                     Roo.MessageBox.alert('Error', 'Please select a pulldown');
444                     return;
445                 }
446                 
447                 Pman.Dialog.Image.show(
448                    {
449                         _url : baseURL+'/Admin/Import/Enum?' + Roo.urlEncode({'etype' : etype})
450                     
451                    },
452                    function () {
453                         _this.grid.footer.onClick('first');
454                    }
455                );
456             }
457           }
458          }
459         ]
460
461        },
462        toolbar : {
463         '|xns' : 'Roo',
464         xns : Roo,
465         xtype : 'Toolbar',
466         items : [
467          {
468           '|xns' : 'Roo.Toolbar',
469           cls : 'x-btn-text-icon',
470           icon : baseURL + '/Pman/templates/images/search.gif',
471           text : _this._strings['d9ec74f5aa29ceef6bf7b45f7fec5d0f'],
472           xns : Roo.Toolbar,
473           xtype : 'Button',
474           listeners : {
475            click : function()
476             {
477                 
478                 // if we do not have a selected type... - what should we show..?
479                 
480                 
481                 var s =     _this.egrid.getSelectionModel().getSelectedCell();
482                 
483             
484                 if (!s) {
485                     Roo.MessageBox.alert("Error", "Select a pulldown");
486                 }
487                 
488                 var d = _this.egrid.dataSource.getAt(s[0]);
489              
490             
491                 var ds = _this.grid.getDataSource();
492             
493                 var add = ds.reader.newRow({    
494                          id: 0, 
495                          display_name : '', 
496                          name : '', 
497                          etype: d.data.name, 
498                          active: 1, 
499                          seqid: 0
500                   });
501             
502                 ds.insert(0  , add);  
503                 
504                 _this.grid.startEditing(0, _this.grid.colModel.getIndexByDataIndex('name')); // name... 
505             }
506           }
507          },
508          {
509           '|xns' : 'Roo.Toolbar',
510           cls : 'x-btn-text-icon',
511           icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
512           text : _this._strings['b9c49611cfda3259a2b837b39489e650'],
513           xns : Roo.Toolbar,
514           xtype : 'Button',
515           listeners : {
516            click : function()
517             {
518                 
519                 // if we do not have a selected type... - what should we show..?
520                 var et = _this.etypeCombo.getValue();
521                 
522                 if (!et) {
523                     Roo.MessageBox.alert("Error", "Select a pulldown");
524                     return;
525                 }
526                 var sc = _this.grid.getSelectionModel().getSelectedCell();
527                 Roo.log(sc);
528                 var ds = _this.grid.ds.getAt(sc[0]);
529                 if (!ds) {
530                     Roo.MessageBox.alert("Error", "Select enum");
531                     return;
532                 }
533                 
534                 Roo.log(ds);
535                 Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){
536                     _this.grid.footer.onClick('first');
537                 });
538                 
539             }
540           }
541          },
542          {
543           '|xns' : 'Roo.form',
544           fieldLabel : 'Search',
545           name : 'search',
546           xns : Roo.form,
547           xtype : 'TextField',
548           listeners : {
549            render : function (_self)
550             {
551                 _this.searchBox = this;
552             }
553           }
554          },
555          {
556           '|xns' : 'Roo.Toolbar',
557           cls : 'x-btn-icon',
558           icon : rootURL + '/Pman/templates/images/search.gif',
559           xns : Roo.Toolbar,
560           xtype : 'Button',
561           listeners : {
562            click : function (_self, e)
563             {
564                 _this.grid.footer.onClick('first');
565             }
566           }
567          },
568          {
569           '|xns' : 'Roo.Toolbar',
570           cls : 'x-btn-icon',
571           icon : rootURL + '/Pman/templates/images/edit-clear.gif',
572           xns : Roo.Toolbar,
573           xtype : 'Button',
574           listeners : {
575            click : function (_self, e)
576             {
577                  _this.searchBox.setValue('');
578                  _this.grid.footer.onClick('first');
579             }
580           }
581          },
582          {
583           '|xns' : 'Roo.Toolbar',
584           xns : Roo.Toolbar,
585           xtype : 'Fill'
586          },
587          {
588           '|xns' : 'Roo.Toolbar',
589           cls : 'x-btn-text-icon',
590           icon : rootURL + '/Pman/templates/images/trash.gif',
591           text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
592           xns : Roo.Toolbar,
593           xtype : 'Button',
594           listeners : {
595            click : function()
596             {
597                 var ids = [];
598                 _this.grid.dataSource.each(function(rr) {
599                     if (rr.selected) {
600                         ids.push(rr.data.id);
601                     }
602                 });   
603                 if (!ids.length) {
604                     Roo.MessageBox.alert("Error", "Select rows by clicking on the Internal# column");
605                     return;
606                 }
607                 
608                 Roo.MessageBox.confirm(
609                     "Confirm", 
610                     "Confirm Deletion of selected rows (some rows can not be deleted if they are referenced elsewhere", 
611                     function(res) {
612                         if(res != 'yes') {
613                             return;
614                         }
615                         new Pman.Request({
616                             method : 'POST',
617                             url : baseURL + '/Roo/Core_enum',
618                             params : {
619                                 _delete  : ids.join(',')
620                             },
621                             success : function() {
622                                 _this.grid.footer.onClick('refresh');
623                             }
624                         });
625                     }
626                 );
627                 
628                 
629             }
630           }
631          },
632          {
633           '|xns' : 'Roo.Toolbar',
634           xns : Roo.Toolbar,
635           xtype : 'Separator'
636          },
637          {
638           '|xns' : 'Roo.Toolbar',
639           cls : 'x-btn-text-icon',
640           icon : Roo.rootURL + 'images/default/tree/leaf.gif',
641           text : _this._strings['1a87a3d29199e3435b8fb314624c008f'],
642           xns : Roo.Toolbar,
643           xtype : 'Button',
644           listeners : {
645            click : function()
646             {
647                 var s = _this.grid.getSelectionModel().getSelectedCell();
648                 
649                 if (!s.length)  {
650                     Roo.MessageBox.alert("Error", "Select a Row");
651                     return;
652                 }
653                 
654                 Roo.log(s);
655                 
656                 var d = _this.grid.ds.getAt(s[0]);
657                 
658                 Pman.Dialog.AdminEnumMerge.show(d, function() {
659                     _this.grid.footer.onClick('first');
660                 }); 
661                 
662             }
663           }
664          }
665         ]
666
667        },
668        '|xns' : 'Roo.grid',
669        autoExpandColumn : 'display_name',
670        clicksToEdit : 1,
671        loadMask : true,
672        xns : Roo.grid,
673        xtype : 'EditorGrid',
674        colModel : [
675          {
676           '|xns' : 'Roo.grid',
677           dataIndex : 'id',
678           header : _this._strings['7af54708cf5a4286cf0cfa58ff5148a8'],
679           renderer : function(v,x,r) { 
680               var fmt = '{0}';
681               if (r.selected) {
682                   fmt = '<span style="color:orange;font-weight:bold;">{0}</span>';
683               }
684               return String.format(fmt, v); },
685           sortable : true,
686           width : 75,
687           xns : Roo.grid,
688           xtype : 'ColumnModel'
689          },
690 {
691           '|xns' : 'Roo.grid',
692           dataIndex : 'images_id_id',
693           header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'],
694           renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/25/{1}/{2}" width="25" height="25">', baseURL, v, r.data.images_id_filename); },
695           width : 75,
696           xns : Roo.grid,
697           xtype : 'ColumnModel'
698          },
699 {
700           editor : {
701            field : {
702             '|xns' : 'Roo.form',
703             xns : Roo.form,
704             xtype : 'TextField'
705            },
706            '|xns' : 'Roo.grid',
707            xns : Roo.grid,
708            xtype : 'GridEditor',
709            items : [
710
711            ]
712
713           },
714           '|xns' : 'Roo.grid',
715           dataIndex : 'name',
716           header : _this._strings['49ee3087348e8d44e1feda1917443987'],
717           renderer : function(v) { return String.format('{0}', v); },
718           sortable : true,
719           width : 200,
720           xns : Roo.grid,
721           xtype : 'ColumnModel',
722           items : [
723
724           ]
725
726          },
727 {
728           editor : {
729            field : {
730             '|xns' : 'Roo.form',
731             xns : Roo.form,
732             xtype : 'TextField'
733            },
734            '|xns' : 'Roo.grid',
735            xns : Roo.grid,
736            xtype : 'GridEditor',
737            items : [
738
739            ]
740
741           },
742           '|xns' : 'Roo.grid',
743           dataIndex : 'display_name',
744           header : _this._strings['b48968e1c912da07df5e8d6d246291ec'],
745           renderer : function(v) { return String.format('{0}', v); },
746           sortable : true,
747           width : 200,
748           xns : Roo.grid,
749           xtype : 'ColumnModel',
750           items : [
751
752           ]
753
754          },
755 {
756           '|xns' : 'Roo.grid',
757           dataIndex : 'active',
758           header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
759           renderer : function(v) {  
760               var state = v> 0 ?  '-checked' : '';
761           
762               return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
763                           
764            },
765           sortable : true,
766           width : 75,
767           xns : Roo.grid,
768           xtype : 'ColumnModel'
769          },
770 {
771           editor : {
772            field : {
773             '|xns' : 'Roo.form',
774             allowDecimals : false,
775             allowNegative : true,
776             decimalPrecision : 0,
777             xns : Roo.form,
778             xtype : 'NumberField'
779            },
780            '|xns' : 'Roo.grid',
781            xns : Roo.grid,
782            xtype : 'GridEditor',
783            items : [
784
785            ]
786
787           },
788           '|xns' : 'Roo.grid',
789           dataIndex : 'seqid',
790           header : _this._strings['d1228f5476d15142b1358ae4b5fa2454'],
791           renderer : function(v) { return String.format('{0}', v); },
792           sortable : true,
793           sortable : true,
794           width : 75,
795           xns : Roo.grid,
796           xtype : 'ColumnModel',
797           items : [
798
799           ]
800
801          }
802        ],
803        listeners : {
804         afteredit : function (e)
805          {
806             e.record.commit();     
807          },
808         beforeedit : function (e)
809          {
810              if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
811                  return false;
812              }
813          },
814         cellclick : function (_self, rowIndex, columnIndex, e)
815          {
816          
817                  var di = this.colModel.getDataIndex(columnIndex);
818                  var rec = _this.grid.ds.getAt(rowIndex);
819                      
820                  if (di == 'active') {
821                      
822                      rec.set('active', rec.data.active ? 0 : 1);
823                      rec.commit();
824                      return;
825                  }
826                  if (di == 'id' ) {
827                      
828                      if (!e.ctrlKey && !e.shiftKey) { // shift or control not pressed -clear selection.
829                      
830                          this.dataSource.each(function(rr) {
831                              rr.selected = 0;
832                              rr.set('sel', 0);
833                          });
834                      }
835                      
836                      if (this.last_selected && e.shiftKey) {
837                          // the highlight all the lines between the one last selected, and this one.
838                          var s = this.dataSource.indexOf(this.last_selected);
839                          var e = this.dataSource.indexOf(rec);
840                          var ss = Math.min(s,e);
841                          var ee = Math.max(s,e) +1;
842                          for(var i = ss; i < ee; i++) {
843                              var rr = this.dataSource.getAt(i);
844                              rr.selected = 1;
845                              rr.set('sel', 1);
846                          }
847                          this.last_selected = rec;
848                          return;
849          
850                      }
851                      
852                      rec.selected = rec.selected ? 0 : 1;
853                      this.last_selected = rec.selected ? rec : false;
854                      rec.set('sel', rec.data.sel ? 0 : 1);
855                  }
856                   
857          
858                   
859                  
860          },
861         keypress : function (e)
862          {
863              if(e.keyCode == 13){
864                  _this.grid.footer.onClick('first');
865              }
866          },
867         render : function() 
868          {
869              _this.grid = this; 
870              //_this.dialog = Pman.Dialog.FILL_IN
871              if (_this.panel.active) {
872                 this.footer.onClick('first');
873              }
874          }
875        },
876        items : [
877
878        ]
879
880       },
881       '|xns' : 'Roo',
882       background : false,
883       fitToframe : true,
884       region : 'center',
885       tableName : 'core_enum',
886       title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
887       xns : Roo,
888       xtype : 'GridPanel',
889       listeners : {
890        activate : function() {
891             _this.panel = this;
892             if (_this.grid) {
893                 _this.grid.footer.onClick('first');
894             }
895         }
896       },
897       items : [
898
899       ]
900
901      }
902     ]
903
904    },
905    '|xns' : 'Roo',
906    region : 'center',
907    title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
908    xns : Roo,
909    xtype : 'NestedLayoutPanel',
910    items : [
911
912    ]
913
914   };  }
915 });