91e91dea2b3d46d982e8dcf4dd5df9363867f2fa
[app.Builder.js] / resources / Editors / Editor.Roo.LayoutDialog.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('Editor.Roo');
6
7 Editor.Roo.LayoutDialog = new Roo.XComponent({
8
9  _strings : {
10   'b021df6aac4654c454f46c77646e745f' :"Label",
11   '793548e77e782c209a78ed67f255b5e2' :"Display Field",
12   '040076bde7f6b3387448e32b66c2eee0' :"To BJS",
13   '4ce58cbe362a5d7b156992a496d55bf3' :"Database Column",
14   '189efd19c4153526994a6d7ea5f6f068' :"Field Type",
15   '2f616612593df62aeed112de4f03110e' :"Edit a Grid",
16   '0ccc2bf3fb98387c23b6ca5500244d6e' :"Use ",
17   'c671c787b49f50a3ace9fdc5bd597825' :"core_enum",
18   '32954654ac8fe66a1d09be19001de2d4' :"Width",
19   'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
20   '6e7376dca68a2386a8737944196ab491' :"Create / Edit Grid",
21   'f541774a08fc687f6e2016c77a6ebca5' :"Load Data"
22  },
23
24   part     :  ["Editors", "LayoutDialog" ],
25   order    : '001-Editor.Roo.LayoutDialog',
26   region   : 'center',
27   parent   : false,
28   name     : "unnamed module",
29   disabled : false, 
30   permname : '', 
31   _tree : function()
32   {
33    var _this = this;
34    var MODULE = this;
35    return {
36    grid : {
37     ds : {
38      '|xns' : 'Roo.data',
39      data : [
40        [ 1, 'test', 'test', 110 ]
41        
42      
43      ],
44      fields : [ 
45          'active', 
46          'dataIndex', 
47          'type',
48          'title', 
49          'width', 
50          'ftype', 
51          'display_field',
52          'relates_to_table',
53          'relates_to_col',
54          'relates_to_schema'
55      ],
56      id : 'dataindex',
57      xns : Roo.data,
58      xtype : 'SimpleStore'
59     },
60     toolbar : {
61      '|xns' : 'Roo',
62      xns : Roo,
63      xtype : 'Toolbar',
64      items : [
65       {
66        '|xns' : 'Roo.Toolbar',
67        text : _this._strings['2f616612593df62aeed112de4f03110e'],
68        xns : Roo.Toolbar,
69        xtype : 'TextItem'
70       },
71       {
72        '|xns' : 'Roo.Toolbar',
73        xns : Roo.Toolbar,
74        xtype : 'Fill'
75       },
76       {
77        '|xns' : 'Roo.Toolbar',
78        text : _this._strings['f541774a08fc687f6e2016c77a6ebca5'],
79        xns : Roo.Toolbar,
80        xtype : 'Button',
81        listeners : {
82         click : function (_self, e)
83          {
84              var data = {    
85                  "manage_scale_id": {
86                      "Field": "manage_scale_id",
87                      "Type": "int(11)",
88                      "Null": "NO",
89                      "Key": null,
90                      "Default": "0",
91                      "Extra": null,
92                      "relates_to_table": "core_enum",
93                      "relates_to_col": "id",
94                      "relates_to_schema": {
95                          "id": {
96                              "Field": "id",
97                              "Type": "int(11)",
98                              "Null": "NO",
99                              "Key": "PRI",
100                              "Default": null,
101                              "Extra": "auto_increment"
102                          },
103                          "etype": {
104                              "Field": "etype",
105                              "Type": "varchar(32)",
106                              "Null": "NO",
107                              "Key": null,
108                              "Default": null,
109                              "Extra": null
110                          },
111                          "name": {
112                              "Field": "name",
113                              "Type": "varchar(255)",
114                              "Null": "NO",
115                              "Key": null,
116                              "Default": null,
117                              "Extra": null
118                          },
119                          "active": {
120                              "Field": "active",
121                              "Type": "int(2)",
122                              "Null": "NO",
123                              "Key": null,
124                              "Default": "1",
125                              "Extra": null
126                          },
127                          "seqid": {
128                              "Field": "seqid",
129                              "Type": "int(11)",
130                              "Null": "NO",
131                              "Key": "MUL",
132                              "Default": "0",
133                              "Extra": null
134                          },
135                          "seqmax": {
136                              "Field": "seqmax",
137                              "Type": "int(11)",
138                              "Null": "NO",
139                              "Key": null,
140                              "Default": "0",
141                              "Extra": null
142                          },
143                          "display_name": {
144                              "Field": "display_name",
145                              "Type": "text",
146                              "Null": "NO",
147                              "Key": null,
148                              "Default": null,
149                              "Extra": null
150                          },
151                          "is_system_enum": {
152                              "Field": "is_system_enum",
153                              "Type": "int(2)",
154                              "Null": "NO",
155                              "Key": null,
156                              "Default": "0",
157                              "Extra": null
158                          }
159                      }
160                  },
161                  "person_type": {
162                      "Field": "person_type",
163                      "Type": "text",
164                      "Null": "NO",
165                      "Key": null,
166                      "Default": null,
167                      "Extra": null
168                  },
169                  "employer_name": {
170                      "Field": "employer_name",
171                      "Type": "text",
172                      "Null": "NO",
173                      "Key": null,
174                      "Default": null,
175                      "Extra": null
176                  },
177                  "birth_date": {
178                      "Field": "birth_date",
179                      "Type": "date",
180                      "Null": "NO",
181                      "Key": null,
182                      "Default": "0000-00-00",
183                      "Extra": null
184                  },
185                  "employ_start_date": {
186                      "Field": "employ_start_date",
187                      "Type": "date",
188                      "Null": "NO",
189                      "Key": null,
190                      "Default": "0000-00-00",
191                      "Extra": null
192                  },
193                  "employ_end_date": {
194                      "Field": "employ_end_date",
195                      "Type": "date",
196                      "Null": "NO",
197                      "Key": null,
198                      "Default": "0000-00-00",
199                      "Extra": null
200                  },
201                  "hide_same_employer": {
202                      "Field": "hide_same_employer",
203                      "Type": "int(4)",
204                      "Null": "NO",
205                      "Key": null,
206                      "Default": "0",
207                      "Extra": null
208                  },
209                  "salary_currency": {
210                      "Field": "salary_currency",
211                      "Type": "varchar(256)",
212                      "Null": "NO",
213                      "Key": null,
214                      "Default": null,
215                      "Extra": null
216                  },
217                  "quota_currency": {
218                      "Field": "quota_currency",
219                      "Type": "varchar(256)",
220                      "Null": "NO",
221                      "Key": null,
222                      "Default": null,
223                      "Extra": null
224                  },
225                  "created_dt": {
226                      "Field": "created_dt",
227                      "Type": "datetime",
228                      "Null": "NO",
229                      "Key": null,
230                      "Default": "0000-00-00 00:00:00",
231                      "Extra": null
232                  },
233                  "updated_dt": {
234                      "Field": "updated_dt",
235                      "Type": "datetime",
236                      "Null": "NO",
237                      "Key": null,
238                      "Default": "0000-00-00 00:00:00",
239                      "Extra": null
240                  }
241              };
242              
243              Roo.log('Loading Data...');
244              _this.panel.loadData(data);
245          
246          }
247        }
248       },
249       {
250        '|xns' : 'Roo.Toolbar',
251        xns : Roo.Toolbar,
252        xtype : 'Separator'
253       },
254       {
255        '|xns' : 'Roo.Toolbar',
256        text : _this._strings['040076bde7f6b3387448e32b66c2eee0'],
257        xns : Roo.Toolbar,
258        xtype : 'Button',
259        listeners : {
260         click : function (_self, e)
261          {
262              
263              Roo.log('Converting to BJS...');
264              _this.panel.toBJS();
265          
266          }
267        }
268       }
269      ]
270
271     },
272     '|xns' : 'Roo.grid',
273     autoExpandColumn : 'title',
274     clicksToEdit : 1,
275     loadMask : true,
276     xns : Roo.grid,
277     xtype : 'EditorGrid',
278     cm : [
279       {
280        '|xns' : 'Roo.grid',
281        dataIndex : 'active',
282        header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
283        renderer : function(v) {  
284            var state = v *1 > 0 ?  '-checked' : '';
285        
286            return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
287                        
288         },
289        width : 75,
290        xns : Roo.grid,
291        xtype : 'ColumnModel'
292       },
293 {
294        '|xns' : 'Roo.grid',
295        dataIndex : 'dataIndex',
296        header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
297        renderer : function(v) { return String.format('{0}', v); },
298        width : 150,
299        xns : Roo.grid,
300        xtype : 'ColumnModel'
301       },
302 {
303        '|xns' : 'Roo.grid',
304        dataIndex : 'type',
305        header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
306        renderer : function(v) { return String.format('{0}', v); },
307        width : 100,
308        xns : Roo.grid,
309        xtype : 'ColumnModel'
310       },
311 {
312        editor : {
313         field : {
314          '|xns' : 'Roo.form',
315          xns : Roo.form,
316          xtype : 'TextField'
317         },
318         '|xns' : 'Roo.grid',
319         xns : Roo.grid,
320         xtype : 'GridEditor',
321         items : [
322
323         ]
324
325        },
326        '|xns' : 'Roo.grid',
327        dataIndex : 'title',
328        header : _this._strings['b021df6aac4654c454f46c77646e745f'],
329        renderer : function(v) { return String.format('{0}', v); },
330        width : 120,
331        xns : Roo.grid,
332        xtype : 'ColumnModel',
333        items : [
334
335        ]
336
337       },
338 {
339        editor : {
340         field : {
341          store : {
342           '|xns' : 'Roo.data',
343           data : [ 
344               [ 'ComboBox', "ComboBox"],
345               [ 'ComboBoxArray', "ComboBoxArray"],
346               [ 'TextField' , "TextField"],
347               [ 'NumberField', "NumberField"],
348               [ 'TextArea', "TextArea"],
349               [ 'HtmlEditor', "HtmlEditor"],
350               [ 'Hidden', "Hidden"],
351               [ 'DateField', "DateField"],
352               [ 'Checkbox', "Checkbox"]    
353               // checkbox?
354           ],
355           fields : [  'ftype', 'fname'],
356           xns : Roo.data,
357           xtype : 'SimpleStore'
358          },
359          '|xns' : 'Roo.form',
360          allowBlank : false,
361          displayField : 'fname',
362          editable : false,
363          hiddenName : 'status',
364          listWidth : 200,
365          mode : 'local',
366          name : 'ftype',
367          triggerAction : 'all',
368          valueField : 'ftype',
369          width : 150,
370          xns : Roo.form,
371          xtype : 'ComboBox',
372          items : [
373
374          ]
375
376         },
377         '|xns' : 'Roo.grid',
378         xns : Roo.grid,
379         xtype : 'GridEditor',
380         items : [
381
382         ]
383
384        },
385        '|xns' : 'Roo.grid',
386        dataIndex : 'ftype',
387        header : _this._strings['189efd19c4153526994a6d7ea5f6f068'],
388        renderer : function(v) { return String.format('{0}', v); },
389        width : 120,
390        xns : Roo.grid,
391        xtype : 'ColumnModel',
392        items : [
393
394        ]
395
396       },
397 {
398        editor : {
399         field : {
400          store : {
401           '|xns' : 'Roo.data',
402           data : [ 
403               ['id']
404           ],
405           fields : [  'dfield'],
406           xns : Roo.data,
407           xtype : 'SimpleStore'
408          },
409          '|xns' : 'Roo.form',
410          allowBlank : false,
411          displayField : 'dfield',
412          editable : false,
413          hiddenName : 'status',
414          listWidth : 200,
415          mode : 'local',
416          name : 'display_field',
417          triggerAction : 'all',
418          valueField : 'dfield',
419          width : 150,
420          xns : Roo.form,
421          xtype : 'ComboBox',
422          items : [
423
424          ]
425
426         },
427         '|xns' : 'Roo.grid',
428         xns : Roo.grid,
429         xtype : 'GridEditor',
430         items : [
431
432         ]
433
434        },
435        '|xns' : 'Roo.grid',
436        dataIndex : 'display_field',
437        header : _this._strings['793548e77e782c209a78ed67f255b5e2'],
438        renderer : function(v) { return String.format('{0}', v); },
439        width : 150,
440        xns : Roo.grid,
441        xtype : 'ColumnModel',
442        items : [
443
444        ]
445
446       },
447 {
448        editor : {
449         field : {
450          '|xns' : 'Roo.form',
451          decimalPrecision : 0,
452          xns : Roo.form,
453          xtype : 'NumberField'
454         },
455         '|xns' : 'Roo.grid',
456         xns : Roo.grid,
457         xtype : 'GridEditor',
458         items : [
459
460         ]
461
462        },
463        '|xns' : 'Roo.grid',
464        dataIndex : 'width',
465        header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
466        renderer : function(v) { return String.format('{0}', v); },
467        width : 75,
468        xns : Roo.grid,
469        xtype : 'ColumnModel',
470        items : [
471
472        ]
473
474       }
475     ],
476     listeners : {
477      beforeedit : function (e)
478       {
479           Roo.log('before edit!!!');
480           Roo.log(e);
481           
482           if(e.field != 'display_field'){
483               return;
484           }
485           
486           _this.grid.colModel.getCellEditor(e.column, e.row).field.store.loadData(e.record.data.relates_to_schema);
487       },
488      cellclick : function (_self, rowIndex, columnIndex, e)
489       {
490       
491               var di = this.colModel.getDataIndex(columnIndex);
492               if (di != 'active') {
493                   return;
494               }
495                
496               var rec = _this.grid.ds.getAt(rowIndex);
497               
498               rec.set('active', rec.data.active * 1 ? 0 : 1);
499               rec.commit();
500                
501               
502       },
503      render : function() 
504       {
505           _this.grid = this; 
506           //_this.dialog = Pman.Dialog.FILL_IN
507       
508       },
509      rowdblclick : function (_self, rowIndex, e)
510       {
511           if (!_this.dialog) return;
512         
513       }
514     },
515     items : [
516
517     ]
518
519    },
520    '|xns' : 'Roo',
521    background : false,
522    fitContainer : true,
523    fitToframe : true,
524    loadData : function(data) { 
525    
526        //alert("IPC:TEST:" + JSON.stringify(data,null,4));
527    
528        var textFile = null;
529        
530        var makeTextFile = function (text) {
531            var data = new Blob([text], {type: 'text/plain'});
532    
533            // If we are replacing a previously generated file we need to
534            // manually revoke the object URL to avoid memory leaks.
535            if (textFile !== null) {
536              window.URL.revokeObjectURL(textFile);
537            }
538    
539            textFile = window.URL.createObjectURL(data);
540    
541            return textFile;
542          };
543        
544        
545        alert("IPC:TEST:" + makeTextFile(JSON.stringify(data,null,4)));
546        return;
547        
548        var fields = _this.grid.dataSource.reader.recordType.prototype.fields;
549        
550        
551        var d = [];
552    
553        for (var k in data) { 
554            var r = data[k];
555            var has_s = typeof(r.relates_to_schema) != 'undefined';
556            
557            Roo.log(r.Type);
558            var field_type = 'TextField';
559            
560            if (r.Type == 'text'){
561                field_type = 'TextArea';
562            }
563            
564            if(r.Type == 'date' || r.Type == 'datetime'){
565                field_type = 'DateField';
566            }
567                
568            var regex = /(.*?)\((.*?)\)/;
569            
570            if(regex.test(r.Type)){
571                var type_match = regex.exec(r.Type);
572                
573                if(type_match[1] == 'int'){
574                    field_type = 'NumberField';
575                        
576                    if(type_match[2] * 1  < 11){
577                        field_type = 'CheckBox';
578                    }
579                }
580            } 
581            
582            var rt = '', rc = '', rs = [];
583            
584            if(has_s){
585                for (var kk in r.relates_to_schema) {         
586                    var rr = r.relates_to_schema[kk];
587                    
588                    rt = r.relates_to_table;
589                    rc = r.relates_to_col;
590                    
591                    rs.push([rr.Field]);
592                    
593                }
594                
595                field_type = 'ComboBox';
596            }
597            
598            if(r.Field == 'id'){ // usually 'id' is hidden on the form
599                field_type = 'Hidden';
600            }
601            
602            
603            
604            var o = {
605                active : !has_s,
606                dataIndex : r.Field,
607                type : r.Type,
608                title : r.Field,
609                width : 200,
610                ftype : field_type,
611                display_field : rc, //r.Field + '_display_name',
612                relates_to_table : rt,
613                relates_to_col : rc,
614                relates_to_schema : rs
615            };
616            
617            d.push(o);
618            
619        }
620    
621        var ar = [];
622        
623        Roo.each(d, function(dd){
624    
625            var a = [];
626            
627            for(var j = 0; j < fields.length; j++){
628                var f = fields.items[j];
629                
630                if(dd.hasOwnProperty(f.name)){
631                    a.push(dd[f.name]);
632                }
633            }
634            
635            ar.push(a);
636        });
637        
638        this.schema = data;
639        
640        //alert("IPC:TEST:" + JSON.stringify(ar));
641        this.grid.dataSource.loadData(ar);
642    },
643    region : 'center',
644    tableName : 'core_enum',
645    title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
646    title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
647    toBJS : function() { 
648    
649    // convert the selected cells into a BJS data ready to send back to the UI..
650    
651        this.table = "XXX";
652        this.firstTxtCol = "XXX";
653       
654        var formHeight = 50;
655        
656        var jreader = {};
657        var  formElements = [];
658        this.grid.dataSource.each(function(rec) {
659            if (!rec.data.active) {
660                return;
661            }
662            
663            var el = {
664                fieldLabel : rec.data.title,
665                name : rec.data.dataIndex,
666                width : rec.data.width,
667                '|xns' : 'Roo.form',
668                xtype : rec.data.ftype
669            }
670             if (el.xtype == 'DateField') {
671                el.format = 'Y-m-d';
672                el.useIso = true;
673                el.width = 100;
674            }
675            
676            if (el.xtype == 'TextArea') {
677                el.height = 100;
678            }
679            
680            if (el.xtype == 'Hidden') {
681                delete el.fieldLabel;
682                delete el.width;
683            }
684            
685            if (el.xtype == 'ComboBox') {
686            
687                el.alwaysQuery = true;
688                el.triggerAction = 'all';
689                el.forceSelection = true;
690                el.selectOnFocus = true;
691                el.minChars = 2;
692                el.editable = true;
693                el.emptyText = 'Select a value';
694                
695                
696                el.queryParam  = 'query[' + rec.data.display_field + ']';// SET WHEN USED
697                
698                el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id
699                el.name  = rec.data.dataIndex + '_' + rec.data.display_field; // SET WHEN USED eg. project_id_name
700                
701                el.displayField = rec.data.display_field // SET WHEN USED eg. project_id
702                el.valueField = rec.data.relates_to_col 
703                
704                el.tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + rec.data.display_field +'}</b> </div>'; // SET WHEN USED
705              
706            
707               el.items = [
708                    {
709                            
710                        '*prop' : 'store',
711                        'xtype' : 'Store',
712                        '|xns' : 'Roo.data',
713                        'remoteSort' : true,
714                        '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
715                        listeners : {
716                            '|beforeload' : 'function (_self, o)' +
717                            "{\n" +
718                            "    o.params = o.params || {};\n" +
719                            "    // set more here\n" +
720                            "}\n"
721                        },
722                        items : [
723                            {
724                                '*prop' : 'proxy',
725                                'xtype' : 'HttpProxy',
726                                'method' : 'GET',
727                                '|xns' : 'Roo.data',
728                                '|url' : "baseURL + '/Roo/" + rec.data.relates_to_table + ".php'",
729                            },
730                            
731                            {
732                                '*prop' : 'reader',
733                                'xtype' : 'JsonReader',
734                                '|xns' : 'Roo.data',
735                                'id' : 'id',
736                                'root' : 'data',
737                                'totalProperty' : 'total'
738    
739                                
740                            }
741                        ]
742                    }
743                ];
744            
745            }
746            
747            if (el.xtype == 'ComboBoxArray') {
748            
749                el.hiddenName = rec.data.dataIndex;
750                el.name = rec.data.dataIndex + '_' + rec.data.display_field;
751                
752                el.items = [
753                    {
754                        'alwaysQuery' : true,
755                        'triggerAction' : 'all',
756                        'forceSelection': true,
757                        'selectOnFocus' : true,
758                        'minChars' :2,
759                        'editable' : true,
760                        'emptyText' : 'Select a value',
761                        'displayField' : rec.data.display_field,
762                        'valueField' : rec.data.relates_to_col,
763                        'xtype' : 'ComboBox',
764                        '$ xns' : 'Roo.form',
765                        '* prop' : 'combo',
766                        'queryParam' : 'query[' + rec.data.display_field + ']',
767                        'tpl' : '<div class="x-grid-cell-text x-btn button"><b>{' + rec.data.display_field +'}</b> </div>',
768                        
769                        items : [
770                            {
771                                '*prop' : 'store',
772                                'xtype' : 'Store',
773                                '|xns' : 'Roo.data',
774                                'remoteSort' : true,
775                                '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
776                                listeners : {
777                                    '|beforeload' : 'function (_self, o)' +
778                                    "{\n" +
779                                    "    o.params = o.params || {};\n" +
780                                    "    // set more here\n" +
781                                    "}\n"
782                                },
783                                items : [
784                                    {
785                                        '*prop' : 'proxy',
786                                        'xtype' : 'HttpProxy',
787                                        'method' : 'GET',
788                                        '|xns' : 'Roo.data',
789                                        '|url' : "baseURL + '/Roo/" + rec.data.relates_to_table + ".php'",
790                                    },
791                                    {
792                                        '*prop' : 'reader',
793                                        'xtype' : 'JsonReader',
794                                        '|xns' : 'Roo.data',
795                                        'id' : 'id',
796                                        'root' : 'data',
797                                        'totalProperty' : 'total'
798                                    }
799                                
800                                ]
801                            }
802                        ]
803                    }
804                ];
805            }
806            
807            if (el.xtype == 'HtmlEditor') {
808                el.height = 250,
809                el.resizable = 's',
810                el.items = [
811                    {
812                        '* prop' : 'toolbars[]',
813                        '|xns' : 'Roo.form.HtmlEditor',
814                        'xtype' : 'ToolbarContext'
815                    },
816                    {
817                        '* prop' : 'toolbars[]',
818                        '|xns' : 'Roo.form.HtmlEditor',
819                        'xtype' : 'ToolbarStandard'
820    
821                   }
822                ]
823            }
824            
825            formElements.push(el);
826            
827            formHeight += rec.data.ftype == 'TextArea' ? 100 : ((rec.data.ftype == 'HtmlEditor') ? 250 : 30);
828            
829            
830        });
831        
832        
833        
834        
835        
836        
837         var frmCfg = 
838        {
839            '|xns' : 'Roo.form',
840            xtype : "Form",
841            listeners : {
842                "|actioncomplete" : "function(_self,action)\n"+
843                    "{\n"+
844                    "    if (action.type == 'setdata') {\n"+
845                    "       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
846                    "       return;\n"+
847                    "    }\n"+
848                    "    if (action.type == 'load') {\n"+
849                    "        return;\n"+
850                    "    }\n"+
851                    "    if (action.type =='submit') {\n"+
852                    "    \n"+
853                    "        _this.dialog.hide();\n"+
854                    "    \n"+
855                    "         if (_this.callback) {\n"+
856                    "            _this.callback.call(_this, action.result.data);\n"+
857                    "         }\n"+
858                    "         _this.form.reset();\n"+
859                    "         return;\n"+
860                    "    }\n"+
861                    "}\n",
862                
863                "|rendered" : "function (form)\n"+
864                    "{\n"+
865                    "    _this.form= form;\n"+
866                    "}\n"
867            },
868            method : "POST",
869            style : "margin:10px;",
870            "|url" : "baseURL + '/Roo/" + this.table + "'",
871            items : formElements
872        };
873        
874    
875        alert("IPC:OUT:" + JSON.stringify({
876                "closable": false,
877                "collapsible": false,
878                "height": formHeight,
879                "resizable": false,
880                "title": "Edit / Create " + this.table,
881                "width": 400,
882                "modal" : true,
883                "xtype": "LayoutDialog",
884                "|xns": "Roo",
885                "items": [
886                    {
887                        "|xns": "Roo",
888                        "xtype": "LayoutRegion",
889                        "*prop": "center"
890                    },
891                    {
892                        "region": "center",
893                        "xtype": "ContentPanel",
894                        "|xns": "Roo",
895                        "items": [
896                            frmCfg
897                        ]
898                    },
899                    
900                    {
901                        "listeners": {
902                            "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
903                        },
904                        "*prop": "buttons[]",
905                        "text": "Cancel",
906                        "xtype": "Button",
907                        "|xns": "Roo"
908                    },
909                    {
910                        "listeners": {
911                            "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
912                        },
913                        "*prop": "buttons[]",
914                        "text": "Save",
915                        "xtype": "Button",
916                        "|xns": "Roo"
917                    }
918                ]
919            
920            
921            
922        }, null, 4));
923    
924    },
925    xns : Roo,
926    xtype : 'GridPanel',
927    listeners : {
928     activate : function() {
929          _this.panel = this;
930          if (_this.grid) {
931              _this.grid.footer.onClick('first');
932          }
933      }
934    },
935    items : [
936
937    ]
938
939   };  }
940 });