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 ]
69 'name': 'display_field',
83 '|xns' : 'Roo.Toolbar',
84 text : _this._strings['2f616612593df62aeed112de4f03110e'],
89 '|xns' : 'Roo.Toolbar',
94 '|xns' : 'Roo.Toolbar',
95 text : _this._strings['dc30ec20708ef7b0f641ef78b7880a15'],
99 click : function (_self, e)
101 Roo.log(_this.ftype_combo);
104 "Field": "manage_scale_id",
110 "relates_to_table": "core_enum",
111 "relates_to_col": "id",
112 "relates_to_schema": {
119 "Extra": "auto_increment"
123 "Type": "varchar(32)",
131 "Type": "varchar(255)",
162 "Field": "display_name",
170 "Field": "is_system_enum",
180 "Field": "person_type",
188 "Field": "employer_name",
196 "Field": "birth_date",
200 "Default": "0000-00-00",
203 "employ_start_date": {
204 "Field": "employ_start_date",
208 "Default": "0000-00-00",
212 "Field": "employ_end_date",
216 "Default": "0000-00-00",
219 "hide_same_employer": {
220 "Field": "hide_same_employer",
228 "Field": "salary_currency",
229 "Type": "varchar(256)",
236 "Field": "quota_currency",
237 "Type": "varchar(256)",
244 "Field": "created_dt",
248 "Default": "0000-00-00 00:00:00",
252 "Field": "updated_dt",
256 "Default": "0000-00-00 00:00:00",
261 Roo.log('debuging...');
262 _this.panel.loadData(data);
271 autoExpandColumn : 'title',
275 xtype : 'EditorGrid',
279 dataIndex : 'active',
280 header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
281 renderer : function(v) {
282 var state = v *1 > 0 ? '-checked' : '';
284 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
289 xtype : 'ColumnModel'
293 dataIndex : 'dataIndex',
294 header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
295 renderer : function(v) { return String.format('{0}', v); },
298 xtype : 'ColumnModel'
303 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
304 renderer : function(v) { return String.format('{0}', v); },
307 xtype : 'ColumnModel'
318 xtype : 'GridEditor',
326 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
327 renderer : function(v) { return String.format('{0}', v); },
330 xtype : 'ColumnModel',
342 [ 'ComboBox', "ComboBox"],
343 [ 'TextField' , "TextField"],
344 [ 'NumberField', "NumberField"],
345 [ 'TextArea', "TextArea"],
346 [ 'HtmlEditor', "HtmlEditor"],
347 [ 'Hidden', "Hidden"],
348 [ 'DateField', "DateField"],
349 [ 'Checkbox', "Checkbox"]
352 fields : [ 'ftype', 'fname'],
354 xtype : 'SimpleStore'
358 displayField : 'fname',
360 hiddenName : 'status',
364 triggerAction : 'all',
365 valueField : 'ftype',
376 xtype : 'GridEditor',
384 header : _this._strings['189efd19c4153526994a6d7ea5f6f068'],
385 renderer : function(v) { return String.format('{0}', v); },
388 xtype : 'ColumnModel',
400 [ 'ComboBox', "ComboBox"],
401 [ 'Text' , "TextField"],
402 [ 'Number', "NumberField"],
403 [ 'TextArea', "TextArea"],
404 [ 'Html', "HtmlEntry"]
407 fields : [ 'ftype', 'fname'],
409 xtype : 'SimpleStore'
413 displayField : 'fname',
415 hiddenName : 'status',
418 name : 'display_field',
419 triggerAction : 'all',
420 valueField : 'ftype',
431 xtype : 'GridEditor',
438 dataIndex : 'display_field',
439 header : _this._strings['793548e77e782c209a78ed67f255b5e2'],
440 renderer : function(v) { return String.format('{0}', v); },
443 xtype : 'ColumnModel',
453 decimalPrecision : 0,
455 xtype : 'NumberField'
459 xtype : 'GridEditor',
467 header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
468 renderer : function(v) { return String.format('{0}', v); },
471 xtype : 'ColumnModel',
479 cellclick : function (_self, rowIndex, columnIndex, e)
482 var di = this.colModel.getDataIndex(columnIndex);
483 if (di != 'active') {
487 var rec = _this.grid.ds.getAt(rowIndex);
489 rec.set('active', rec.data.active * 1 ? 0 : 1);
497 //_this.dialog = Pman.Dialog.FILL_IN
500 rowdblclick : function (_self, rowIndex, e)
502 if (!_this.dialog) return;
515 loadData : function(data) {
517 //alert("IPC:TEST:" + JSON.stringify(data,null,4));
520 for (var k in data) {
522 var has_s = typeof(r.relates_to_schema) != 'undefined'
529 ar.push([ !has_s , r.Field, r.Type, r.Field, 100 , 'TextField', r.Field + '_display_name'] );
534 for (var kk in r.relates_to_schema) {
535 var rr = r.relates_to_schema[kk];
536 if (rr.Field == r.relates_to_col) {
539 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
545 //alert("IPC:TEST:" + JSON.stringify(ar));
546 this.grid.dataSource.loadData(ar);
549 tableName : 'core_enum',
550 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
551 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
554 // convert the selected cells into a BJS data ready to send back to the UI..
557 this.firstTxtCol = "XXX";
562 var formElements = [];
563 this.grid.dataSource.each(function(rec) {
564 if (!rec.data.active) {
569 fieldLabel : rec.data.title,
570 name : rec.data.dataIndex,
571 width : 200, //row.type == 'string' ? 200 : 75,
573 xtype : rec.data.ftype
575 if (xtype == 'DateField') {
581 if (xtype == 'TextArea') {
585 if (xtype == 'Hidden') {
586 delete el.fieldLabel;
589 if (xtype == 'Combobox') {
592 el.queryParam = 'query[' + combofields_name + ']';// SET WHEN USED
594 el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id
595 el.displayField = combofields_name; // SET WHEN USED eg. project_id
596 el.name = old.name + '_' + combofields_name; // SET WHEN USED eg. project_id_name
597 el.tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + combofields_name +'}</b> </div>'; // SET WHEN USED
607 '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
609 '|beforeload' : 'function (_self, o)' +
611 " o.params = o.params || {};\n" +
612 " // set more here\n" +
618 'xtype' : 'HttpProxy',
621 '|url' : "baseURL + '/Roo/" + reftable + ".php'",
626 'xtype' : 'JsonReader',
630 'totalProperty' : 'total'
641 formElements.push(el);
643 formHeight += rec.data.ftype == 'TextArea' ? 100 : 30;
658 "|actioncomplete" : "function(_self,action)\n"+
660 " if (action.type == 'setdata') {\n"+
661 " //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
664 " if (action.type == 'load') {\n"+
667 " if (action.type =='submit') {\n"+
669 " _this.dialog.hide();\n"+
671 " if (_this.callback) {\n"+
672 " _this.callback.call(_this, action.result.data);\n"+
674 " _this.form.reset();\n"+
679 "|rendered" : "function (form)\n"+
681 " _this.form= form;\n"+
685 style : "margin:10px;",
686 "|url" : "baseURL + '/Roo/" + this.table + "'",
691 alert("IPC:OUT:" + JSON.stringify({
693 "collapsible": false,
694 "height": formHeight,
696 "title": "Edit / Create " + this.table,
699 "xtype": "LayoutDialog",
704 "xtype": "LayoutRegion",
709 "xtype": "ContentPanel",
718 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
720 "*prop": "buttons[]",
727 "click": "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
729 "*prop": "buttons[]",
744 activate : function() {
747 _this.grid.footer.onClick('first');