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)
80 autoExpandColumn : 'title',
89 header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
90 renderer : function(v) {
91 var state = v *1 > 0 ? '-checked' : '';
93 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
102 dataIndex : 'dataIndex',
103 header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
104 renderer : function(v) { return String.format('{0}', v); },
107 xtype : 'ColumnModel'
112 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
113 renderer : function(v) { return String.format('{0}', v); },
116 xtype : 'ColumnModel'
127 xtype : 'GridEditor',
135 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
136 renderer : function(v) { return String.format('{0}', v); },
139 xtype : 'ColumnModel',
151 [ 'ComboBox', "ComboBox"],
152 [ 'TextField' , "TextField"],
153 [ 'NumberField', "NumberField"],
154 [ 'TextArea', "TextArea"],
155 [ 'HtmlEditor', "HtmlEditor"],
156 [ 'Hidden', "Hidden"],
157 [ 'DateField', "DateField"] ,
158 [ 'Checkbox', "Checkbox"]
161 fields : [ 'ftype', 'fname'],
163 xtype : 'SimpleStore'
167 displayField : 'fname',
169 hiddenName : 'status',
173 triggerAction : 'all',
174 valueField : 'ftype',
185 xtype : 'GridEditor',
193 header : _this._strings['189efd19c4153526994a6d7ea5f6f068'],
194 renderer : function(v) { return String.format('{0}', v); },
197 xtype : 'ColumnModel',
209 [ 'ComboBox', "ComboBox"],
210 [ 'Text' , "TextField"],
211 [ 'Number', "NumberField"],
212 [ 'TextArea', "TextArea"],
213 [ 'Html', "HtmlEntry"]
216 fields : [ 'ftype', 'fname'],
218 xtype : 'SimpleStore'
222 displayField : 'fname',
224 hiddenName : 'status',
227 name : 'combo_display',
228 triggerAction : 'all',
229 valueField : 'ftype',
240 xtype : 'GridEditor',
247 dataIndex : 'display_field',
248 header : _this._strings['793548e77e782c209a78ed67f255b5e2'],
249 renderer : function(v) { return String.format('{0}', v); },
252 xtype : 'ColumnModel',
262 decimalPrecision : 0,
264 xtype : 'NumberField'
268 xtype : 'GridEditor',
276 header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
277 renderer : function(v) { return String.format('{0}', v); },
280 xtype : 'ColumnModel',
288 cellclick : function (_self, rowIndex, columnIndex, e)
291 var di = this.colModel.getDataIndex(columnIndex);
292 if (di != 'active') {
296 var rec = _this.grid.ds.getAt(rowIndex);
298 rec.set('active', rec.data.active * 1 ? 0 : 1);
306 //_this.dialog = Pman.Dialog.FILL_IN
309 rowdblclick : function (_self, rowIndex, e)
311 if (!_this.dialog) return;
324 loadData : function(data) {
326 alert("IPC:TEST:" + JSON.stringify(data,null,4));
329 for (var k in data) {
331 var has_s = typeof(r.relates_to_schema) != 'undefined'
332 ar.push([ !has_s , r.Field, r.Type, r.Field, 100 , 'TextField', r.Field + '_display_name'] );
337 for (var kk in r.relates_to_schema) {
338 var rr = r.relates_to_schema[kk];
339 if (rr.Field == r.relates_to_col) {
342 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
347 //alert("IPC:TEST:" + JSON.stringify(ar));
348 this.grid.dataSource.loadData(ar);
351 tableName : 'core_enum',
352 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
353 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
356 // convert the selected cells into a BJS data ready to send back to the UI..
359 this.firstTxtCol = "XXX";
364 var formElements = [];
365 this.grid.dataSource.each(function(rec) {
366 if (!rec.data.active) {
371 fieldLabel : rec.data.title,
372 name : rec.data.dataIndex,
373 width : 200, //row.type == 'string' ? 200 : 75,
375 xtype : rec.data.ftype
377 if (xtype == 'DateField') {
383 if (xtype == 'TextArea') {
387 if (xtype == 'Hidden') {
388 delete el.fieldLabel;
391 if (xtype == 'Combobox') {
394 el.queryParam = 'query[' + combofields_name + ']';// SET WHEN USED
396 el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id
397 el.displayField = combofields_name; // SET WHEN USED eg. project_id
398 el.name = old.name + '_' + combofields_name; // SET WHEN USED eg. project_id_name
399 el.tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + combofields_name +'}</b> </div>'; // SET WHEN USED
409 '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
411 '|beforeload' : 'function (_self, o)' +
413 " o.params = o.params || {};\n" +
414 " // set more here\n" +
420 'xtype' : 'HttpProxy',
423 '|url' : "baseURL + '/Roo/" + reftable + ".php'",
428 'xtype' : 'JsonReader',
432 'totalProperty' : 'total'
443 formElements.push(el);
445 formHeight += rec.data.ftype == 'TextArea' ? 100 : 30;
460 "|actioncomplete" : "function(_self,action)\n"+
462 " if (action.type == 'setdata') {\n"+
463 " //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
466 " if (action.type == 'load') {\n"+
469 " if (action.type =='submit') {\n"+
471 " _this.dialog.hide();\n"+
473 " if (_this.callback) {\n"+
474 " _this.callback.call(_this, action.result.data);\n"+
476 " _this.form.reset();\n"+
481 "|rendered" : "function (form)\n"+
483 " _this.form= form;\n"+
487 style : "margin:10px;",
488 "|url" : "baseURL + '/Roo/" + this.table + "'",
493 alert("IPC:OUT:" + JSON.stringify({
495 "collapsible": false,
496 "height": formHeight,
498 "title": "Edit / Create " + this.table,
501 "xtype": "LayoutDialog",
506 "xtype": "LayoutRegion",
511 "xtype": "ContentPanel",
520 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
522 "*prop": "buttons[]",
529 "click": "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
531 "*prop": "buttons[]",
546 activate : function() {
549 _this.grid.footer.onClick('first');