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)
76 "Field": "manage_scale_id",
82 "relates_to_table": "core_enum",
83 "relates_to_col": "id",
84 "relates_to_schema": {
91 "Extra": "auto_increment"
95 "Type": "varchar(32)",
103 "Type": "varchar(255)",
134 "Field": "display_name",
142 "Field": "is_system_enum",
152 "Field": "person_type",
160 "Field": "employer_name",
168 "Field": "birth_date",
172 "Default": "0000-00-00",
175 "employ_start_date": {
176 "Field": "employ_start_date",
180 "Default": "0000-00-00",
184 "Field": "employ_end_date",
188 "Default": "0000-00-00",
191 "hide_same_employer": {
192 "Field": "hide_same_employer",
200 "Field": "salary_currency",
201 "Type": "varchar(256)",
208 "Field": "quota_currency",
209 "Type": "varchar(256)",
216 "Field": "created_dt",
220 "Default": "0000-00-00 00:00:00",
224 "Field": "updated_dt",
228 "Default": "0000-00-00 00:00:00",
233 Roo.log('debuging...');
234 _this.panel.loadData(data);
243 autoExpandColumn : 'title',
247 xtype : 'EditorGrid',
251 dataIndex : 'active',
252 header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
253 renderer : function(v) {
254 var state = v *1 > 0 ? '-checked' : '';
256 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
261 xtype : 'ColumnModel'
265 dataIndex : 'dataIndex',
266 header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
267 renderer : function(v) { return String.format('{0}', v); },
270 xtype : 'ColumnModel'
275 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
276 renderer : function(v) { return String.format('{0}', v); },
279 xtype : 'ColumnModel'
290 xtype : 'GridEditor',
298 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
299 renderer : function(v) { return String.format('{0}', v); },
302 xtype : 'ColumnModel',
314 [ 'ComboBox', "ComboBox"],
315 [ 'TextField' , "TextField"],
316 [ 'NumberField', "NumberField"],
317 [ 'TextArea', "TextArea"],
318 [ 'HtmlEditor', "HtmlEditor"],
319 [ 'Hidden', "Hidden"],
320 [ 'DateField', "DateField"] ,
321 [ 'Checkbox', "Checkbox"]
324 fields : [ 'ftype', 'fname'],
326 xtype : 'SimpleStore'
330 displayField : 'fname',
332 hiddenName : 'status',
336 triggerAction : 'all',
337 valueField : 'ftype',
348 xtype : 'GridEditor',
356 header : _this._strings['189efd19c4153526994a6d7ea5f6f068'],
357 renderer : function(v) { return String.format('{0}', v); },
360 xtype : 'ColumnModel',
372 [ 'ComboBox', "ComboBox"],
373 [ 'Text' , "TextField"],
374 [ 'Number', "NumberField"],
375 [ 'TextArea', "TextArea"],
376 [ 'Html', "HtmlEntry"]
379 fields : [ 'ftype', 'fname'],
381 xtype : 'SimpleStore'
385 displayField : 'fname',
387 hiddenName : 'status',
390 name : 'combo_display',
391 triggerAction : 'all',
392 valueField : 'ftype',
403 xtype : 'GridEditor',
410 dataIndex : 'display_field',
411 header : _this._strings['793548e77e782c209a78ed67f255b5e2'],
412 renderer : function(v) { return String.format('{0}', v); },
415 xtype : 'ColumnModel',
425 decimalPrecision : 0,
427 xtype : 'NumberField'
431 xtype : 'GridEditor',
439 header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
440 renderer : function(v) { return String.format('{0}', v); },
443 xtype : 'ColumnModel',
451 cellclick : function (_self, rowIndex, columnIndex, e)
454 var di = this.colModel.getDataIndex(columnIndex);
455 if (di != 'active') {
459 var rec = _this.grid.ds.getAt(rowIndex);
461 rec.set('active', rec.data.active * 1 ? 0 : 1);
469 //_this.dialog = Pman.Dialog.FILL_IN
472 rowdblclick : function (_self, rowIndex, e)
474 if (!_this.dialog) return;
487 loadData : function(data) {
489 alert("IPC:TEST:" + JSON.stringify(data,null,4));
492 for (var k in data) {
494 var has_s = typeof(r.relates_to_schema) != 'undefined'
495 ar.push([ !has_s , r.Field, r.Type, r.Field, 100 , 'TextField', r.Field + '_display_name'] );
500 for (var kk in r.relates_to_schema) {
501 var rr = r.relates_to_schema[kk];
502 if (rr.Field == r.relates_to_col) {
505 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
510 //alert("IPC:TEST:" + JSON.stringify(ar));
511 this.grid.dataSource.loadData(ar);
514 tableName : 'core_enum',
515 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
516 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
519 // convert the selected cells into a BJS data ready to send back to the UI..
522 this.firstTxtCol = "XXX";
527 var formElements = [];
528 this.grid.dataSource.each(function(rec) {
529 if (!rec.data.active) {
534 fieldLabel : rec.data.title,
535 name : rec.data.dataIndex,
536 width : 200, //row.type == 'string' ? 200 : 75,
538 xtype : rec.data.ftype
540 if (xtype == 'DateField') {
546 if (xtype == 'TextArea') {
550 if (xtype == 'Hidden') {
551 delete el.fieldLabel;
554 if (xtype == 'Combobox') {
557 el.queryParam = 'query[' + combofields_name + ']';// SET WHEN USED
559 el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id
560 el.displayField = combofields_name; // SET WHEN USED eg. project_id
561 el.name = old.name + '_' + combofields_name; // SET WHEN USED eg. project_id_name
562 el.tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + combofields_name +'}</b> </div>'; // SET WHEN USED
572 '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
574 '|beforeload' : 'function (_self, o)' +
576 " o.params = o.params || {};\n" +
577 " // set more here\n" +
583 'xtype' : 'HttpProxy',
586 '|url' : "baseURL + '/Roo/" + reftable + ".php'",
591 'xtype' : 'JsonReader',
595 'totalProperty' : 'total'
606 formElements.push(el);
608 formHeight += rec.data.ftype == 'TextArea' ? 100 : 30;
623 "|actioncomplete" : "function(_self,action)\n"+
625 " if (action.type == 'setdata') {\n"+
626 " //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
629 " if (action.type == 'load') {\n"+
632 " if (action.type =='submit') {\n"+
634 " _this.dialog.hide();\n"+
636 " if (_this.callback) {\n"+
637 " _this.callback.call(_this, action.result.data);\n"+
639 " _this.form.reset();\n"+
644 "|rendered" : "function (form)\n"+
646 " _this.form= form;\n"+
650 style : "margin:10px;",
651 "|url" : "baseURL + '/Roo/" + this.table + "'",
656 alert("IPC:OUT:" + JSON.stringify({
658 "collapsible": false,
659 "height": formHeight,
661 "title": "Edit / Create " + this.table,
664 "xtype": "LayoutDialog",
669 "xtype": "LayoutRegion",
674 "xtype": "ContentPanel",
683 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
685 "*prop": "buttons[]",
692 "click": "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
694 "*prop": "buttons[]",
709 activate : function() {
712 _this.grid.footer.onClick('first');