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)
74 "Field": "manage_scale_id",
80 "relates_to_table": "core_enum",
81 "relates_to_col": "id",
82 "relates_to_schema": {
89 "Extra": "auto_increment"
93 "Type": "varchar(32)",
101 "Type": "varchar(255)",
132 "Field": "display_name",
140 "Field": "is_system_enum",
150 "Field": "person_type",
158 "Field": "employer_name",
166 "Field": "birth_date",
170 "Default": "0000-00-00",
173 "employ_start_date": {
174 "Field": "employ_start_date",
178 "Default": "0000-00-00",
182 "Field": "employ_end_date",
186 "Default": "0000-00-00",
189 "hide_same_employer": {
190 "Field": "hide_same_employer",
198 "Field": "salary_currency",
199 "Type": "varchar(256)",
206 "Field": "quota_currency",
207 "Type": "varchar(256)",
214 "Field": "created_dt",
218 "Default": "0000-00-00 00:00:00",
222 "Field": "updated_dt",
226 "Default": "0000-00-00 00:00:00",
231 _this.panel.loadData(data);
240 autoExpandColumn : 'title',
244 xtype : 'EditorGrid',
248 dataIndex : 'active',
249 header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
250 renderer : function(v) {
251 var state = v *1 > 0 ? '-checked' : '';
253 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
258 xtype : 'ColumnModel'
262 dataIndex : 'dataIndex',
263 header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
264 renderer : function(v) { return String.format('{0}', v); },
267 xtype : 'ColumnModel'
272 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
273 renderer : function(v) { return String.format('{0}', v); },
276 xtype : 'ColumnModel'
287 xtype : 'GridEditor',
295 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
296 renderer : function(v) { return String.format('{0}', v); },
299 xtype : 'ColumnModel',
311 [ 'ComboBox', "ComboBox"],
312 [ 'TextField' , "TextField"],
313 [ 'NumberField', "NumberField"],
314 [ 'TextArea', "TextArea"],
315 [ 'HtmlEditor', "HtmlEditor"],
316 [ 'Hidden', "Hidden"],
317 [ 'DateField', "DateField"] ,
318 [ 'Checkbox', "Checkbox"]
321 fields : [ 'ftype', 'fname'],
323 xtype : 'SimpleStore'
327 displayField : 'fname',
329 hiddenName : 'status',
333 triggerAction : 'all',
334 valueField : 'ftype',
345 xtype : 'GridEditor',
353 header : _this._strings['189efd19c4153526994a6d7ea5f6f068'],
354 renderer : function(v) { return String.format('{0}', v); },
357 xtype : 'ColumnModel',
369 [ 'ComboBox', "ComboBox"],
370 [ 'Text' , "TextField"],
371 [ 'Number', "NumberField"],
372 [ 'TextArea', "TextArea"],
373 [ 'Html', "HtmlEntry"]
376 fields : [ 'ftype', 'fname'],
378 xtype : 'SimpleStore'
382 displayField : 'fname',
384 hiddenName : 'status',
387 name : 'combo_display',
388 triggerAction : 'all',
389 valueField : 'ftype',
400 xtype : 'GridEditor',
407 dataIndex : 'display_field',
408 header : _this._strings['793548e77e782c209a78ed67f255b5e2'],
409 renderer : function(v) { return String.format('{0}', v); },
412 xtype : 'ColumnModel',
422 decimalPrecision : 0,
424 xtype : 'NumberField'
428 xtype : 'GridEditor',
436 header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
437 renderer : function(v) { return String.format('{0}', v); },
440 xtype : 'ColumnModel',
448 cellclick : function (_self, rowIndex, columnIndex, e)
451 var di = this.colModel.getDataIndex(columnIndex);
452 if (di != 'active') {
456 var rec = _this.grid.ds.getAt(rowIndex);
458 rec.set('active', rec.data.active * 1 ? 0 : 1);
466 //_this.dialog = Pman.Dialog.FILL_IN
469 rowdblclick : function (_self, rowIndex, e)
471 if (!_this.dialog) return;
484 loadData : function(data) {
486 alert("IPC:TEST:" + JSON.stringify(data,null,4));
489 for (var k in data) {
491 var has_s = typeof(r.relates_to_schema) != 'undefined'
492 ar.push([ !has_s , r.Field, r.Type, r.Field, 100 , 'TextField', r.Field + '_display_name'] );
497 for (var kk in r.relates_to_schema) {
498 var rr = r.relates_to_schema[kk];
499 if (rr.Field == r.relates_to_col) {
502 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
507 //alert("IPC:TEST:" + JSON.stringify(ar));
508 this.grid.dataSource.loadData(ar);
511 tableName : 'core_enum',
512 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
513 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
516 // convert the selected cells into a BJS data ready to send back to the UI..
519 this.firstTxtCol = "XXX";
524 var formElements = [];
525 this.grid.dataSource.each(function(rec) {
526 if (!rec.data.active) {
531 fieldLabel : rec.data.title,
532 name : rec.data.dataIndex,
533 width : 200, //row.type == 'string' ? 200 : 75,
535 xtype : rec.data.ftype
537 if (xtype == 'DateField') {
543 if (xtype == 'TextArea') {
547 if (xtype == 'Hidden') {
548 delete el.fieldLabel;
551 if (xtype == 'Combobox') {
554 el.queryParam = 'query[' + combofields_name + ']';// SET WHEN USED
556 el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id
557 el.displayField = combofields_name; // SET WHEN USED eg. project_id
558 el.name = old.name + '_' + combofields_name; // SET WHEN USED eg. project_id_name
559 el.tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + combofields_name +'}</b> </div>'; // SET WHEN USED
569 '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
571 '|beforeload' : 'function (_self, o)' +
573 " o.params = o.params || {};\n" +
574 " // set more here\n" +
580 'xtype' : 'HttpProxy',
583 '|url' : "baseURL + '/Roo/" + reftable + ".php'",
588 'xtype' : 'JsonReader',
592 'totalProperty' : 'total'
603 formElements.push(el);
605 formHeight += rec.data.ftype == 'TextArea' ? 100 : 30;
620 "|actioncomplete" : "function(_self,action)\n"+
622 " if (action.type == 'setdata') {\n"+
623 " //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
626 " if (action.type == 'load') {\n"+
629 " if (action.type =='submit') {\n"+
631 " _this.dialog.hide();\n"+
633 " if (_this.callback) {\n"+
634 " _this.callback.call(_this, action.result.data);\n"+
636 " _this.form.reset();\n"+
641 "|rendered" : "function (form)\n"+
643 " _this.form= form;\n"+
647 style : "margin:10px;",
648 "|url" : "baseURL + '/Roo/" + this.table + "'",
653 alert("IPC:OUT:" + JSON.stringify({
655 "collapsible": false,
656 "height": formHeight,
658 "title": "Edit / Create " + this.table,
661 "xtype": "LayoutDialog",
666 "xtype": "LayoutRegion",
671 "xtype": "ContentPanel",
680 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
682 "*prop": "buttons[]",
689 "click": "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
691 "*prop": "buttons[]",
706 activate : function() {
709 _this.grid.footer.onClick('first');