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   '68be4837f6c739877233e527a996dd00' :"Merge",
16   '7af54708cf5a4286cf0cfa58ff5148a8' :"Internal #",
17   'be53a0541a6d36f6ecb879fa2c584b08' :"Image",
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['68be4837f6c739877233e527a996dd00'],
642           xns : Roo.Toolbar,
643           xtype : 'Button',
644           listeners : {
645            click : function()
646             {
647                 var s = _this.grid.getSelectionModel().getSelections();
648                 if (!s.length || (s.length > 1))  {
649                     Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
650                     return;
651                 }
652                 if (!_this.dialog) return;
653                 _this.dialog.show(s[0].data, function() {
654                     _this.grid.footer.onClick('first');
655                 }); 
656                 
657             }
658           }
659          }
660         ]
661
662        },
663        '|xns' : 'Roo.grid',
664        autoExpandColumn : 'display_name',
665        clicksToEdit : 1,
666        loadMask : true,
667        xns : Roo.grid,
668        xtype : 'EditorGrid',
669        colModel : [
670          {
671           '|xns' : 'Roo.grid',
672           dataIndex : 'id',
673           header : _this._strings['7af54708cf5a4286cf0cfa58ff5148a8'],
674           renderer : function(v,x,r) { 
675               var fmt = '{0}';
676               if (r.selected) {
677                   fmt = '<span style="color:orange;font-weight:bold;">{0}</span>';
678               }
679               return String.format(fmt, v); },
680           sortable : true,
681           width : 75,
682           xns : Roo.grid,
683           xtype : 'ColumnModel'
684          },
685 {
686           '|xns' : 'Roo.grid',
687           dataIndex : 'images_id_id',
688           header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'],
689           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); },
690           width : 75,
691           xns : Roo.grid,
692           xtype : 'ColumnModel'
693          },
694 {
695           editor : {
696            field : {
697             '|xns' : 'Roo.form',
698             xns : Roo.form,
699             xtype : 'TextField'
700            },
701            '|xns' : 'Roo.grid',
702            xns : Roo.grid,
703            xtype : 'GridEditor',
704            items : [
705
706            ]
707
708           },
709           '|xns' : 'Roo.grid',
710           dataIndex : 'name',
711           header : _this._strings['49ee3087348e8d44e1feda1917443987'],
712           renderer : function(v) { return String.format('{0}', v); },
713           sortable : true,
714           width : 200,
715           xns : Roo.grid,
716           xtype : 'ColumnModel',
717           items : [
718
719           ]
720
721          },
722 {
723           editor : {
724            field : {
725             '|xns' : 'Roo.form',
726             xns : Roo.form,
727             xtype : 'TextField'
728            },
729            '|xns' : 'Roo.grid',
730            xns : Roo.grid,
731            xtype : 'GridEditor',
732            items : [
733
734            ]
735
736           },
737           '|xns' : 'Roo.grid',
738           dataIndex : 'display_name',
739           header : _this._strings['b48968e1c912da07df5e8d6d246291ec'],
740           renderer : function(v) { return String.format('{0}', v); },
741           sortable : true,
742           width : 200,
743           xns : Roo.grid,
744           xtype : 'ColumnModel',
745           items : [
746
747           ]
748
749          },
750 {
751           '|xns' : 'Roo.grid',
752           dataIndex : 'active',
753           header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
754           renderer : function(v) {  
755               var state = v> 0 ?  '-checked' : '';
756           
757               return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
758                           
759            },
760           sortable : true,
761           width : 75,
762           xns : Roo.grid,
763           xtype : 'ColumnModel'
764          },
765 {
766           editor : {
767            field : {
768             '|xns' : 'Roo.form',
769             allowDecimals : false,
770             allowNegative : true,
771             decimalPrecision : 0,
772             xns : Roo.form,
773             xtype : 'NumberField'
774            },
775            '|xns' : 'Roo.grid',
776            xns : Roo.grid,
777            xtype : 'GridEditor',
778            items : [
779
780            ]
781
782           },
783           '|xns' : 'Roo.grid',
784           dataIndex : 'seqid',
785           header : _this._strings['d1228f5476d15142b1358ae4b5fa2454'],
786           renderer : function(v) { return String.format('{0}', v); },
787           sortable : true,
788           sortable : true,
789           width : 75,
790           xns : Roo.grid,
791           xtype : 'ColumnModel',
792           items : [
793
794           ]
795
796          }
797        ],
798        listeners : {
799         afteredit : function (e)
800          {
801             e.record.commit();     
802          },
803         beforeedit : function (e)
804          {
805              if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){
806                  return false;
807              }
808          },
809         cellclick : function (_self, rowIndex, columnIndex, e)
810          {
811          
812                  var di = this.colModel.getDataIndex(columnIndex);
813                  var rec = _this.grid.ds.getAt(rowIndex);
814                      
815                  if (di == 'active') {
816                      
817                      rec.set('active', rec.data.active ? 0 : 1);
818                      rec.commit();
819                      return;
820                  }
821                  if (di == 'id' ) {
822                      
823                      if (!e.ctrlKey && !e.shiftKey) { // shift or control not pressed -clear selection.
824                      
825                          this.dataSource.each(function(rr) {
826                              rr.selected = 0;
827                              rr.set('sel', 0);
828                          });
829                      }
830                      
831                      if (this.last_selected && e.shiftKey) {
832                          // the highlight all the lines between the one last selected, and this one.
833                          var s = this.dataSource.indexOf(this.last_selected);
834                          var e = this.dataSource.indexOf(rec);
835                          var ss = Math.min(s,e);
836                          var ee = Math.max(s,e) +1;
837                          for(var i = ss; i < ee; i++) {
838                              var rr = this.dataSource.getAt(i);
839                              rr.selected = 1;
840                              rr.set('sel', 1);
841                          }
842                          this.last_selected = rec;
843                          return;
844          
845                      }
846                      
847                      rec.selected = rec.selected ? 0 : 1;
848                      this.last_selected = rec.selected ? rec : false;
849                      rec.set('sel', rec.data.sel ? 0 : 1);
850                  }
851                   
852          
853                   
854                  
855          },
856         keypress : function (e)
857          {
858              if(e.keyCode == 13){
859                  _this.grid.footer.onClick('first');
860              }
861          },
862         render : function() 
863          {
864              _this.grid = this; 
865              //_this.dialog = Pman.Dialog.FILL_IN
866              if (_this.panel.active) {
867                 this.footer.onClick('first');
868              }
869          }
870        },
871        items : [
872
873        ]
874
875       },
876       '|xns' : 'Roo',
877       background : false,
878       fitToframe : true,
879       region : 'center',
880       tableName : 'core_enum',
881       title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
882       xns : Roo,
883       xtype : 'GridPanel',
884       listeners : {
885        activate : function() {
886             _this.panel = this;
887             if (_this.grid) {
888                 _this.grid.footer.onClick('first');
889             }
890         }
891       },
892       items : [
893
894       ]
895
896      }
897     ]
898
899    },
900    '|xns' : 'Roo',
901    region : 'center',
902    title : _this._strings['2df80d5febcde0c10a66818488622b7c'],
903    xns : Roo,
904    xtype : 'NestedLayoutPanel',
905    items : [
906
907    ]
908
909   };  }
910 });