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)
60 '|xns' : 'Roo.Toolbar',
61 text : _this._strings['2f616612593df62aeed112de4f03110e'],
66 '|xns' : 'Roo.Toolbar',
71 '|xns' : 'Roo.Toolbar',
72 text : _this._strings['dc30ec20708ef7b0f641ef78b7880a15'],
76 click : function (_self, e)
78 Roo.log(_this.ftype_combo);
81 "Field": "manage_scale_id",
87 "relates_to_table": "core_enum",
88 "relates_to_col": "id",
89 "relates_to_schema": {
96 "Extra": "auto_increment"
100 "Type": "varchar(32)",
108 "Type": "varchar(255)",
139 "Field": "display_name",
147 "Field": "is_system_enum",
157 "Field": "person_type",
165 "Field": "employer_name",
173 "Field": "birth_date",
177 "Default": "0000-00-00",
180 "employ_start_date": {
181 "Field": "employ_start_date",
185 "Default": "0000-00-00",
189 "Field": "employ_end_date",
193 "Default": "0000-00-00",
196 "hide_same_employer": {
197 "Field": "hide_same_employer",
205 "Field": "salary_currency",
206 "Type": "varchar(256)",
213 "Field": "quota_currency",
214 "Type": "varchar(256)",
221 "Field": "created_dt",
225 "Default": "0000-00-00 00:00:00",
229 "Field": "updated_dt",
233 "Default": "0000-00-00 00:00:00",
238 Roo.log('debuging...');
239 _this.panel.loadData(data);
248 autoExpandColumn : 'title',
252 xtype : 'EditorGrid',
256 dataIndex : 'active',
257 header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
258 renderer : function(v) {
259 var state = v *1 > 0 ? '-checked' : '';
261 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
266 xtype : 'ColumnModel'
270 dataIndex : 'dataIndex',
271 header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
272 renderer : function(v) { return String.format('{0}', v); },
275 xtype : 'ColumnModel'
280 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
281 renderer : function(v) { return String.format('{0}', v); },
284 xtype : 'ColumnModel'
295 xtype : 'GridEditor',
303 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
304 renderer : function(v) { return String.format('{0}', v); },
307 xtype : 'ColumnModel',
319 [ 'ComboBox', "ComboBox"],
320 [ 'TextField' , "TextField"],
321 [ 'NumberField', "NumberField"],
322 [ 'TextArea', "TextArea"],
323 [ 'HtmlEditor', "HtmlEditor"],
324 [ 'Hidden', "Hidden"],
325 [ 'DateField', "DateField"],
326 [ 'Checkbox', "Checkbox"]
329 fields : [ 'ftype', 'fname'],
331 xtype : 'SimpleStore'
335 displayField : 'fname',
337 hiddenName : 'status',
341 triggerAction : 'all',
342 valueField : 'ftype',
353 xtype : 'GridEditor',
361 header : _this._strings['189efd19c4153526994a6d7ea5f6f068'],
362 renderer : function(v) { return String.format('{0}', v); },
365 xtype : 'ColumnModel',
377 [ 'ComboBox', "ComboBox"],
378 [ 'Text' , "TextField"],
379 [ 'Number', "NumberField"],
380 [ 'TextArea', "TextArea"],
381 [ 'Html', "HtmlEntry"]
384 fields : [ 'ftype', 'fname'],
386 xtype : 'SimpleStore'
390 displayField : 'fname',
392 hiddenName : 'status',
395 name : 'display_field',
396 triggerAction : 'all',
397 valueField : 'ftype',
402 render : function (_self)
404 Roo.log('render!!!!!!!!!!!1');
406 select : function (combo, record, index)
418 xtype : 'GridEditor',
425 dataIndex : 'display_field',
426 header : _this._strings['793548e77e782c209a78ed67f255b5e2'],
427 renderer : function(v) { return String.format('{0}', v); },
430 xtype : 'ColumnModel',
440 decimalPrecision : 0,
442 xtype : 'NumberField'
446 xtype : 'GridEditor',
454 header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
455 renderer : function(v) { return String.format('{0}', v); },
458 xtype : 'ColumnModel',
466 cellclick : function (_self, rowIndex, columnIndex, e)
469 var di = this.colModel.getDataIndex(columnIndex);
470 if (di != 'active') {
474 var rec = _this.grid.ds.getAt(rowIndex);
476 rec.set('active', rec.data.active * 1 ? 0 : 1);
484 //_this.dialog = Pman.Dialog.FILL_IN
487 rowdblclick : function (_self, rowIndex, e)
489 if (!_this.dialog) return;
502 loadData : function(data) {
504 //alert("IPC:TEST:" + JSON.stringify(data,null,4));
507 for (var k in data) {
509 var has_s = typeof(r.relates_to_schema) != 'undefined'
510 ar.push([ !has_s , r.Field, r.Type, r.Field, 100 , 'TextField', r.Field + '_display_name'] );
515 for (var kk in r.relates_to_schema) {
516 var rr = r.relates_to_schema[kk];
517 if (rr.Field == r.relates_to_col) {
520 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
526 //alert("IPC:TEST:" + JSON.stringify(ar));
527 this.grid.dataSource.loadData(ar);
530 tableName : 'core_enum',
531 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
532 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
535 // convert the selected cells into a BJS data ready to send back to the UI..
538 this.firstTxtCol = "XXX";
543 var formElements = [];
544 this.grid.dataSource.each(function(rec) {
545 if (!rec.data.active) {
550 fieldLabel : rec.data.title,
551 name : rec.data.dataIndex,
552 width : 200, //row.type == 'string' ? 200 : 75,
554 xtype : rec.data.ftype
556 if (xtype == 'DateField') {
562 if (xtype == 'TextArea') {
566 if (xtype == 'Hidden') {
567 delete el.fieldLabel;
570 if (xtype == 'Combobox') {
573 el.queryParam = 'query[' + combofields_name + ']';// SET WHEN USED
575 el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id
576 el.displayField = combofields_name; // SET WHEN USED eg. project_id
577 el.name = old.name + '_' + combofields_name; // SET WHEN USED eg. project_id_name
578 el.tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + combofields_name +'}</b> </div>'; // SET WHEN USED
588 '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
590 '|beforeload' : 'function (_self, o)' +
592 " o.params = o.params || {};\n" +
593 " // set more here\n" +
599 'xtype' : 'HttpProxy',
602 '|url' : "baseURL + '/Roo/" + reftable + ".php'",
607 'xtype' : 'JsonReader',
611 'totalProperty' : 'total'
622 formElements.push(el);
624 formHeight += rec.data.ftype == 'TextArea' ? 100 : 30;
639 "|actioncomplete" : "function(_self,action)\n"+
641 " if (action.type == 'setdata') {\n"+
642 " //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
645 " if (action.type == 'load') {\n"+
648 " if (action.type =='submit') {\n"+
650 " _this.dialog.hide();\n"+
652 " if (_this.callback) {\n"+
653 " _this.callback.call(_this, action.result.data);\n"+
655 " _this.form.reset();\n"+
660 "|rendered" : "function (form)\n"+
662 " _this.form= form;\n"+
666 style : "margin:10px;",
667 "|url" : "baseURL + '/Roo/" + this.table + "'",
672 alert("IPC:OUT:" + JSON.stringify({
674 "collapsible": false,
675 "height": formHeight,
677 "title": "Edit / Create " + this.table,
680 "xtype": "LayoutDialog",
685 "xtype": "LayoutRegion",
690 "xtype": "ContentPanel",
699 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
701 "*prop": "buttons[]",
708 "click": "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
710 "*prop": "buttons[]",
725 activate : function() {
728 _this.grid.footer.onClick('first');