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 Roo.log('debuging...');
232 _this.panel.loadData(data);
241 autoExpandColumn : 'title',
245 xtype : 'EditorGrid',
249 dataIndex : 'active',
250 header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
251 renderer : function(v) {
252 var state = v *1 > 0 ? '-checked' : '';
254 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
259 xtype : 'ColumnModel'
263 dataIndex : 'dataIndex',
264 header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
265 renderer : function(v) { return String.format('{0}', v); },
268 xtype : 'ColumnModel'
273 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
274 renderer : function(v) { return String.format('{0}', v); },
277 xtype : 'ColumnModel'
288 xtype : 'GridEditor',
296 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
297 renderer : function(v) { return String.format('{0}', v); },
300 xtype : 'ColumnModel',
312 [ 'ComboBox', "ComboBox"],
313 [ 'TextField' , "TextField"],
314 [ 'NumberField', "NumberField"],
315 [ 'TextArea', "TextArea"],
316 [ 'HtmlEditor', "HtmlEditor"],
317 [ 'Hidden', "Hidden"],
318 [ 'DateField', "DateField"] ,
319 [ 'Checkbox', "Checkbox"]
322 fields : [ 'ftype', 'fname'],
324 xtype : 'SimpleStore'
328 displayField : 'fname',
330 hiddenName : 'status',
334 triggerAction : 'all',
335 valueField : 'ftype',
346 xtype : 'GridEditor',
354 header : _this._strings['189efd19c4153526994a6d7ea5f6f068'],
355 renderer : function(v) { return String.format('{0}', v); },
358 xtype : 'ColumnModel',
370 [ 'ComboBox', "ComboBox"],
371 [ 'Text' , "TextField"],
372 [ 'Number', "NumberField"],
373 [ 'TextArea', "TextArea"],
374 [ 'Html', "HtmlEntry"]
377 fields : [ 'ftype', 'fname'],
379 xtype : 'SimpleStore'
383 displayField : 'fname',
385 hiddenName : 'status',
388 name : 'combo_display',
389 triggerAction : 'all',
390 valueField : 'ftype',
401 xtype : 'GridEditor',
408 dataIndex : 'display_field',
409 header : _this._strings['793548e77e782c209a78ed67f255b5e2'],
410 renderer : function(v) { return String.format('{0}', v); },
413 xtype : 'ColumnModel',
423 decimalPrecision : 0,
425 xtype : 'NumberField'
429 xtype : 'GridEditor',
437 header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
438 renderer : function(v) { return String.format('{0}', v); },
441 xtype : 'ColumnModel',
449 cellclick : function (_self, rowIndex, columnIndex, e)
452 var di = this.colModel.getDataIndex(columnIndex);
453 if (di != 'active') {
457 var rec = _this.grid.ds.getAt(rowIndex);
459 rec.set('active', rec.data.active * 1 ? 0 : 1);
467 //_this.dialog = Pman.Dialog.FILL_IN
470 rowdblclick : function (_self, rowIndex, e)
472 if (!_this.dialog) return;
485 loadData : function(data) {
487 alert("IPC:TEST:" + JSON.stringify(data,null,4));
490 for (var k in data) {
492 var has_s = typeof(r.relates_to_schema) != 'undefined'
493 ar.push([ !has_s , r.Field, r.Type, r.Field, 100 , 'TextField', r.Field + '_display_name'] );
498 for (var kk in r.relates_to_schema) {
499 var rr = r.relates_to_schema[kk];
500 if (rr.Field == r.relates_to_col) {
503 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
508 //alert("IPC:TEST:" + JSON.stringify(ar));
509 this.grid.dataSource.loadData(ar);
512 tableName : 'core_enum',
513 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
514 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
517 // convert the selected cells into a BJS data ready to send back to the UI..
520 this.firstTxtCol = "XXX";
525 var formElements = [];
526 this.grid.dataSource.each(function(rec) {
527 if (!rec.data.active) {
532 fieldLabel : rec.data.title,
533 name : rec.data.dataIndex,
534 width : 200, //row.type == 'string' ? 200 : 75,
536 xtype : rec.data.ftype
538 if (xtype == 'DateField') {
544 if (xtype == 'TextArea') {
548 if (xtype == 'Hidden') {
549 delete el.fieldLabel;
552 if (xtype == 'Combobox') {
555 el.queryParam = 'query[' + combofields_name + ']';// SET WHEN USED
557 el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id
558 el.displayField = combofields_name; // SET WHEN USED eg. project_id
559 el.name = old.name + '_' + combofields_name; // SET WHEN USED eg. project_id_name
560 el.tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + combofields_name +'}</b> </div>'; // SET WHEN USED
570 '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
572 '|beforeload' : 'function (_self, o)' +
574 " o.params = o.params || {};\n" +
575 " // set more here\n" +
581 'xtype' : 'HttpProxy',
584 '|url' : "baseURL + '/Roo/" + reftable + ".php'",
589 'xtype' : 'JsonReader',
593 'totalProperty' : 'total'
604 formElements.push(el);
606 formHeight += rec.data.ftype == 'TextArea' ? 100 : 30;
621 "|actioncomplete" : "function(_self,action)\n"+
623 " if (action.type == 'setdata') {\n"+
624 " //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
627 " if (action.type == 'load') {\n"+
630 " if (action.type =='submit') {\n"+
632 " _this.dialog.hide();\n"+
634 " if (_this.callback) {\n"+
635 " _this.callback.call(_this, action.result.data);\n"+
637 " _this.form.reset();\n"+
642 "|rendered" : "function (form)\n"+
644 " _this.form= form;\n"+
648 style : "margin:10px;",
649 "|url" : "baseURL + '/Roo/" + this.table + "'",
654 alert("IPC:OUT:" + JSON.stringify({
656 "collapsible": false,
657 "height": formHeight,
659 "title": "Edit / Create " + this.table,
662 "xtype": "LayoutDialog",
667 "xtype": "LayoutRegion",
672 "xtype": "ContentPanel",
681 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
683 "*prop": "buttons[]",
690 "click": "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
692 "*prop": "buttons[]",
707 activate : function() {
710 _this.grid.footer.onClick('first');