1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Editor.Roo');
7 Editor.Roo.LayoutDialog = new Roo.XComponent({
10 'b021df6aac4654c454f46c77646e745f' :"Label",
11 '793548e77e782c209a78ed67f255b5e2' :"Display Field",
12 '4ce58cbe362a5d7b156992a496d55bf3' :"Database Column",
13 '189efd19c4153526994a6d7ea5f6f068' :"Field Type",
14 '2f616612593df62aeed112de4f03110e' :"Edit a Grid",
15 '0ccc2bf3fb98387c23b6ca5500244d6e' :"Use ",
16 'c671c787b49f50a3ace9fdc5bd597825' :"core_enum",
17 'dc30ec20708ef7b0f641ef78b7880a15' :"DEBUG",
18 '32954654ac8fe66a1d09be19001de2d4' :"Width",
19 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
20 '6e7376dca68a2386a8737944196ab491' :"Create / Edit Grid"
23 part : ["Editors", "LayoutDialog" ],
24 order : '001-Editor.Roo.LayoutDialog',
27 name : "unnamed module",
39 [ 1, 'test', 'test', 110 ]
43 fields : [ 'active', 'dataIndex', 'type','title', 'width', 'ftype', 'display_field' ],
54 '|xns' : 'Roo.Toolbar',
55 text : _this._strings['2f616612593df62aeed112de4f03110e'],
60 '|xns' : 'Roo.Toolbar',
65 '|xns' : 'Roo.Toolbar',
66 text : _this._strings['dc30ec20708ef7b0f641ef78b7880a15'],
70 click : function (_self, e)
72 Roo.log(_this.ftype_combo);
75 "Field": "manage_scale_id",
81 "relates_to_table": "core_enum",
82 "relates_to_col": "id",
83 "relates_to_schema": {
90 "Extra": "auto_increment"
94 "Type": "varchar(32)",
102 "Type": "varchar(255)",
133 "Field": "display_name",
141 "Field": "is_system_enum",
151 "Field": "person_type",
159 "Field": "employer_name",
167 "Field": "birth_date",
171 "Default": "0000-00-00",
174 "employ_start_date": {
175 "Field": "employ_start_date",
179 "Default": "0000-00-00",
183 "Field": "employ_end_date",
187 "Default": "0000-00-00",
190 "hide_same_employer": {
191 "Field": "hide_same_employer",
199 "Field": "salary_currency",
200 "Type": "varchar(256)",
207 "Field": "quota_currency",
208 "Type": "varchar(256)",
215 "Field": "created_dt",
219 "Default": "0000-00-00 00:00:00",
223 "Field": "updated_dt",
227 "Default": "0000-00-00 00:00:00",
232 Roo.log('debuging...');
233 _this.panel.loadData(data);
242 autoExpandColumn : 'title',
246 xtype : 'EditorGrid',
250 dataIndex : 'active',
251 header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
252 renderer : function(v) {
253 var state = v *1 > 0 ? '-checked' : '';
255 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
260 xtype : 'ColumnModel'
264 dataIndex : 'dataIndex',
265 header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
266 renderer : function(v) { return String.format('{0}', v); },
269 xtype : 'ColumnModel'
274 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
275 renderer : function(v) { return String.format('{0}', v); },
278 xtype : 'ColumnModel'
289 xtype : 'GridEditor',
297 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
298 renderer : function(v) { return String.format('{0}', v); },
301 xtype : 'ColumnModel',
313 [ 'ComboBox', "ComboBox"],
314 [ 'TextField' , "TextField"],
315 [ 'NumberField', "NumberField"],
316 [ 'TextArea', "TextArea"],
317 [ 'HtmlEditor', "HtmlEditor"],
318 [ 'Hidden', "Hidden"],
319 [ 'DateField', "DateField"],
320 [ 'Checkbox', "Checkbox"]
323 fields : [ 'ftype', 'fname'],
325 xtype : 'SimpleStore'
329 displayField : 'fname',
331 hiddenName : 'status',
335 triggerAction : 'all',
336 valueField : 'ftype',
347 xtype : 'GridEditor',
355 header : _this._strings['189efd19c4153526994a6d7ea5f6f068'],
356 renderer : function(v) { return String.format('{0}', v); },
359 xtype : 'ColumnModel',
371 [ 'ComboBox', "ComboBox"],
372 [ 'Text' , "TextField"],
373 [ 'Number', "NumberField"],
374 [ 'TextArea', "TextArea"],
375 [ 'Html', "HtmlEntry"]
378 fields : [ 'ftype', 'fname'],
380 xtype : 'SimpleStore'
384 displayField : 'fname',
386 hiddenName : 'status',
389 name : 'display_field',
390 triggerAction : 'all',
391 valueField : 'ftype',
402 xtype : 'GridEditor',
404 render : function (_self)
415 dataIndex : 'display_field',
416 header : _this._strings['793548e77e782c209a78ed67f255b5e2'],
417 renderer : function(v) { return String.format('{0}', v); },
420 xtype : 'ColumnModel',
430 decimalPrecision : 0,
432 xtype : 'NumberField'
436 xtype : 'GridEditor',
444 header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
445 renderer : function(v) { return String.format('{0}', v); },
448 xtype : 'ColumnModel',
456 cellclick : function (_self, rowIndex, columnIndex, e)
459 var di = this.colModel.getDataIndex(columnIndex);
460 if (di != 'active') {
464 var rec = _this.grid.ds.getAt(rowIndex);
466 rec.set('active', rec.data.active * 1 ? 0 : 1);
474 //_this.dialog = Pman.Dialog.FILL_IN
477 rowdblclick : function (_self, rowIndex, e)
479 if (!_this.dialog) return;
492 loadData : function(data) {
494 //alert("IPC:TEST:" + JSON.stringify(data,null,4));
497 for (var k in data) {
499 var has_s = typeof(r.relates_to_schema) != 'undefined'
501 ar.push([ !has_s , r.Field, r.Type, r.Field, 100 , 'TextField', r.Field + '_display_name'] );
506 for (var kk in r.relates_to_schema) {
507 var rr = r.relates_to_schema[kk];
508 if (rr.Field == r.relates_to_col) {
511 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
518 //alert("IPC:TEST:" + JSON.stringify(ar));
519 this.grid.dataSource.loadData(ar);
522 tableName : 'core_enum',
523 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
524 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
527 // convert the selected cells into a BJS data ready to send back to the UI..
530 this.firstTxtCol = "XXX";
535 var formElements = [];
536 this.grid.dataSource.each(function(rec) {
537 if (!rec.data.active) {
542 fieldLabel : rec.data.title,
543 name : rec.data.dataIndex,
544 width : 200, //row.type == 'string' ? 200 : 75,
546 xtype : rec.data.ftype
548 if (xtype == 'DateField') {
554 if (xtype == 'TextArea') {
558 if (xtype == 'Hidden') {
559 delete el.fieldLabel;
562 if (xtype == 'Combobox') {
565 el.queryParam = 'query[' + combofields_name + ']';// SET WHEN USED
567 el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id
568 el.displayField = combofields_name; // SET WHEN USED eg. project_id
569 el.name = old.name + '_' + combofields_name; // SET WHEN USED eg. project_id_name
570 el.tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + combofields_name +'}</b> </div>'; // SET WHEN USED
580 '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
582 '|beforeload' : 'function (_self, o)' +
584 " o.params = o.params || {};\n" +
585 " // set more here\n" +
591 'xtype' : 'HttpProxy',
594 '|url' : "baseURL + '/Roo/" + reftable + ".php'",
599 'xtype' : 'JsonReader',
603 'totalProperty' : 'total'
614 formElements.push(el);
616 formHeight += rec.data.ftype == 'TextArea' ? 100 : 30;
631 "|actioncomplete" : "function(_self,action)\n"+
633 " if (action.type == 'setdata') {\n"+
634 " //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
637 " if (action.type == 'load') {\n"+
640 " if (action.type =='submit') {\n"+
642 " _this.dialog.hide();\n"+
644 " if (_this.callback) {\n"+
645 " _this.callback.call(_this, action.result.data);\n"+
647 " _this.form.reset();\n"+
652 "|rendered" : "function (form)\n"+
654 " _this.form= form;\n"+
658 style : "margin:10px;",
659 "|url" : "baseURL + '/Roo/" + this.table + "'",
664 alert("IPC:OUT:" + JSON.stringify({
666 "collapsible": false,
667 "height": formHeight,
669 "title": "Edit / Create " + this.table,
672 "xtype": "LayoutDialog",
677 "xtype": "LayoutRegion",
682 "xtype": "ContentPanel",
691 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
693 "*prop": "buttons[]",
700 "click": "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
702 "*prop": "buttons[]",
717 activate : function() {
720 _this.grid.footer.onClick('first');