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' ],
46 xtype : 'SimpleStore',
48 load : function (_self, records, options)
61 '|xns' : 'Roo.Toolbar',
62 text : _this._strings['2f616612593df62aeed112de4f03110e'],
67 '|xns' : 'Roo.Toolbar',
72 '|xns' : 'Roo.Toolbar',
73 text : _this._strings['dc30ec20708ef7b0f641ef78b7880a15'],
77 click : function (_self, e)
79 Roo.log(_this.ftype_combo);
82 "Field": "manage_scale_id",
88 "relates_to_table": "core_enum",
89 "relates_to_col": "id",
90 "relates_to_schema": {
97 "Extra": "auto_increment"
101 "Type": "varchar(32)",
109 "Type": "varchar(255)",
140 "Field": "display_name",
148 "Field": "is_system_enum",
158 "Field": "person_type",
166 "Field": "employer_name",
174 "Field": "birth_date",
178 "Default": "0000-00-00",
181 "employ_start_date": {
182 "Field": "employ_start_date",
186 "Default": "0000-00-00",
190 "Field": "employ_end_date",
194 "Default": "0000-00-00",
197 "hide_same_employer": {
198 "Field": "hide_same_employer",
206 "Field": "salary_currency",
207 "Type": "varchar(256)",
214 "Field": "quota_currency",
215 "Type": "varchar(256)",
222 "Field": "created_dt",
226 "Default": "0000-00-00 00:00:00",
230 "Field": "updated_dt",
234 "Default": "0000-00-00 00:00:00",
239 Roo.log('debuging...');
240 _this.panel.loadData(data);
249 autoExpandColumn : 'title',
253 xtype : 'EditorGrid',
257 dataIndex : 'active',
258 header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
259 renderer : function(v) {
260 var state = v *1 > 0 ? '-checked' : '';
262 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
267 xtype : 'ColumnModel'
271 dataIndex : 'dataIndex',
272 header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
273 renderer : function(v) { return String.format('{0}', v); },
276 xtype : 'ColumnModel'
281 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
282 renderer : function(v) { return String.format('{0}', v); },
285 xtype : 'ColumnModel'
296 xtype : 'GridEditor',
304 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
305 renderer : function(v) { return String.format('{0}', v); },
308 xtype : 'ColumnModel',
320 [ 'ComboBox', "ComboBox"],
321 [ 'TextField' , "TextField"],
322 [ 'NumberField', "NumberField"],
323 [ 'TextArea', "TextArea"],
324 [ 'HtmlEditor', "HtmlEditor"],
325 [ 'Hidden', "Hidden"],
326 [ 'DateField', "DateField"],
327 [ 'Checkbox', "Checkbox"]
330 fields : [ 'ftype', 'fname'],
332 xtype : 'SimpleStore'
336 displayField : 'fname',
338 hiddenName : 'status',
342 triggerAction : 'all',
343 valueField : 'ftype',
354 xtype : 'GridEditor',
362 header : _this._strings['189efd19c4153526994a6d7ea5f6f068'],
363 renderer : function(v) { return String.format('{0}', v); },
366 xtype : 'ColumnModel',
378 [ 'ComboBox', "ComboBox"],
379 [ 'Text' , "TextField"],
380 [ 'Number', "NumberField"],
381 [ 'TextArea', "TextArea"],
382 [ 'Html', "HtmlEntry"]
385 fields : [ 'ftype', 'fname'],
387 xtype : 'SimpleStore'
391 displayField : 'fname',
393 hiddenName : 'status',
396 name : 'display_field',
397 triggerAction : 'all',
398 valueField : 'ftype',
403 render : function (_self)
405 Roo.log('render!!!!!!!!!!!1');
407 select : function (combo, record, index)
419 xtype : 'GridEditor',
426 dataIndex : 'display_field',
427 header : _this._strings['793548e77e782c209a78ed67f255b5e2'],
428 renderer : function(v) { return String.format('{0}', v); },
431 xtype : 'ColumnModel',
441 decimalPrecision : 0,
443 xtype : 'NumberField'
447 xtype : 'GridEditor',
455 header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
456 renderer : function(v) { return String.format('{0}', v); },
459 xtype : 'ColumnModel',
467 cellclick : function (_self, rowIndex, columnIndex, e)
470 var di = this.colModel.getDataIndex(columnIndex);
471 if (di != 'active') {
475 var rec = _this.grid.ds.getAt(rowIndex);
477 rec.set('active', rec.data.active * 1 ? 0 : 1);
485 //_this.dialog = Pman.Dialog.FILL_IN
488 rowdblclick : function (_self, rowIndex, e)
490 if (!_this.dialog) return;
503 loadData : function(data) {
505 //alert("IPC:TEST:" + JSON.stringify(data,null,4));
508 for (var k in data) {
510 var has_s = typeof(r.relates_to_schema) != 'undefined'
511 ar.push([ !has_s , r.Field, r.Type, r.Field, 100 , 'TextField', r.Field + '_display_name'] );
516 for (var kk in r.relates_to_schema) {
517 var rr = r.relates_to_schema[kk];
518 if (rr.Field == r.relates_to_col) {
521 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
527 //alert("IPC:TEST:" + JSON.stringify(ar));
528 this.grid.dataSource.loadData(ar);
531 tableName : 'core_enum',
532 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
533 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
536 // convert the selected cells into a BJS data ready to send back to the UI..
539 this.firstTxtCol = "XXX";
544 var formElements = [];
545 this.grid.dataSource.each(function(rec) {
546 if (!rec.data.active) {
551 fieldLabel : rec.data.title,
552 name : rec.data.dataIndex,
553 width : 200, //row.type == 'string' ? 200 : 75,
555 xtype : rec.data.ftype
557 if (xtype == 'DateField') {
563 if (xtype == 'TextArea') {
567 if (xtype == 'Hidden') {
568 delete el.fieldLabel;
571 if (xtype == 'Combobox') {
574 el.queryParam = 'query[' + combofields_name + ']';// SET WHEN USED
576 el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id
577 el.displayField = combofields_name; // SET WHEN USED eg. project_id
578 el.name = old.name + '_' + combofields_name; // SET WHEN USED eg. project_id_name
579 el.tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + combofields_name +'}</b> </div>'; // SET WHEN USED
589 '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
591 '|beforeload' : 'function (_self, o)' +
593 " o.params = o.params || {};\n" +
594 " // set more here\n" +
600 'xtype' : 'HttpProxy',
603 '|url' : "baseURL + '/Roo/" + reftable + ".php'",
608 'xtype' : 'JsonReader',
612 'totalProperty' : 'total'
623 formElements.push(el);
625 formHeight += rec.data.ftype == 'TextArea' ? 100 : 30;
640 "|actioncomplete" : "function(_self,action)\n"+
642 " if (action.type == 'setdata') {\n"+
643 " //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
646 " if (action.type == 'load') {\n"+
649 " if (action.type =='submit') {\n"+
651 " _this.dialog.hide();\n"+
653 " if (_this.callback) {\n"+
654 " _this.callback.call(_this, action.result.data);\n"+
656 " _this.form.reset();\n"+
661 "|rendered" : "function (form)\n"+
663 " _this.form= form;\n"+
667 style : "margin:10px;",
668 "|url" : "baseURL + '/Roo/" + this.table + "'",
673 alert("IPC:OUT:" + JSON.stringify({
675 "collapsible": false,
676 "height": formHeight,
678 "title": "Edit / Create " + this.table,
681 "xtype": "LayoutDialog",
686 "xtype": "LayoutRegion",
691 "xtype": "ContentPanel",
700 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
702 "*prop": "buttons[]",
709 "click": "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
711 "*prop": "buttons[]",
726 activate : function() {
729 _this.grid.footer.onClick('first');