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 '32954654ac8fe66a1d09be19001de2d4' :"Width",
18 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
19 '6e7376dca68a2386a8737944196ab491' :"Create / Edit Grid"
22 part : ["Editors", "LayoutDialog" ],
23 order : '001-Editor.Roo.LayoutDialog',
26 name : "unnamed module",
38 [ 1, 'test', 'test', 110 ]
42 fields : [ 'active', 'dataIndex', 'type','title', 'width' ],
53 '|xns' : 'Roo.Toolbar',
54 text : _this._strings['2f616612593df62aeed112de4f03110e'],
62 autoExpandColumn : 'title',
71 header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
72 renderer : function(v) {
73 var state = v *1 > 0 ? '-checked' : '';
75 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
84 dataIndex : 'dataIndex',
85 header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
86 renderer : function(v) { return String.format('{0}', v); },
94 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
95 renderer : function(v) { return String.format('{0}', v); },
109 xtype : 'GridEditor',
117 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
118 renderer : function(v) { return String.format('{0}', v); },
121 xtype : 'ColumnModel',
133 [ 'ComboBox', "ComboBox"],
134 [ 'Text' , "TextField"],
135 [ 'Number', "NumberField"],
136 [ 'TextArea', "TextArea"],
137 [ 'Html', "HtmlEntry"]
140 fields : [ 'ftype', 'fname'],
142 xtype : 'SimpleStore'
146 displayField : 'fname',
148 hiddenName : 'status',
152 triggerAction : 'all',
153 valueField : 'ftype',
164 xtype : 'GridEditor',
172 header : _this._strings['189efd19c4153526994a6d7ea5f6f068'],
173 renderer : function(v) { return String.format('{0}', v); },
176 xtype : 'ColumnModel',
188 [ 'ComboBox', "ComboBox"],
189 [ 'Text' , "TextField"],
190 [ 'Number', "NumberField"],
191 [ 'TextArea', "TextArea"],
192 [ 'Html', "HtmlEntry"]
195 fields : [ 'ftype', 'fname'],
197 xtype : 'SimpleStore'
201 displayField : 'fname',
203 hiddenName : 'status',
207 triggerAction : 'all',
208 valueField : 'ftype',
219 xtype : 'GridEditor',
227 header : _this._strings['793548e77e782c209a78ed67f255b5e2'],
228 renderer : function(v) { return String.format('{0}', v); },
231 xtype : 'ColumnModel',
241 decimalPrecision : 0,
243 xtype : 'NumberField'
247 xtype : 'GridEditor',
255 header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
256 renderer : function(v) { return String.format('{0}', v); },
259 xtype : 'ColumnModel',
267 cellclick : function (_self, rowIndex, columnIndex, e)
270 var di = this.colModel.getDataIndex(columnIndex);
271 if (di != 'active') {
275 var rec = _this.grid.ds.getAt(rowIndex);
277 rec.set('active', rec.data.active * 1 ? 0 : 1);
285 //_this.dialog = Pman.Dialog.FILL_IN
288 rowdblclick : function (_self, rowIndex, e)
290 if (!_this.dialog) return;
303 loadData : function(data) {
305 alert("IPC:TEST:" + JSON.stringify(data,null,4));
307 for (var k in data) {
309 var has_s = typeof(r.relates_to_schema) != 'undefined'
310 ar.push([ !has_s , r.Field, r.Type, r.Field, 100] );
314 for (var kk in r.relates_to_schema) {
315 var rr = r.relates_to_schema[kk];
316 if (rr.Field == r.relates_to_col) {
319 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
323 alert("IPC:TEST:" + JSON.stringify(ar));
324 this.grid.dataSource.loadData(ar);
327 tableName : 'core_enum',
328 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
329 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
332 // convert the selected cells into a BJS data ready to send back to the UI..
335 this.firstTxtCol = "XXX";
340 this.grid.dataSource.each(function(rec) {
341 if (!rec.data.active) {
348 "xtype": "ColumnModel",
349 "header": rec.data.title,
350 "width": rec.data.width * 1,
351 "dataIndex": rec.data.dataIndex,
352 "|renderer": !rec.data.type.match(/date/i) ?
353 "function(v) { return String.format('{0}', v); }" :
354 "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }" , // special for date
363 alert("IPC:OUT:" + JSON.stringify({
368 "fitContainer": true,
369 "tableName": this.table,
373 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
379 "autoExpandColumn": this.firstTxtCol,
382 "|render": "function() \n" +
384 " _this.grid = this; \n" +
385 " //_this.dialog = Pman.Dialog.FILL_IN\n" +
386 " if (_this.panel.active) {\n" +
387 " this.footer.onClick('first');\n" +
390 "|rowdblclick": "function (_self, rowIndex, e)\n" +
392 " if (!_this.dialog) return;\n" +
393 " _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n" +
394 " _this.grid.footer.onClick('first');\n" +
402 "*prop": "dataSource",
405 '|sortInfo' : "{ field : '" + this.firstTxtCol + "', direction: 'ASC' }",
411 "xtype": "HttpProxy",
413 "|url": "baseURL + '/Roo/" + this.table + ".php'",
418 'xtype' : 'JsonReader',
422 'totalProperty' : 'total'
428 "xtype": "PagingToolbar",
431 "displayMsg": "Displaying " + this.table + "{0} - {1} of {2}",
432 "emptyMsg": "No " + this.table + " found",
443 "cls": "x-btn-text-icon",
444 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
446 "|click": "function()\n"+
448 " if (!_this.dialog) return;\n" +
449 " _this.dialog.show( { id : 0 } , function() {\n"+
450 " _this.grid.footer.onClick('first');\n"+
454 "|xns": "Roo.Toolbar"
459 "cls": "x-btn-text-icon",
460 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
463 "|click": "function()\n"+
465 " Pman.genericDelete(_this, '" + this.table + "'); \n"+
469 "|xns": "Roo.Toolbar"
484 activate : function() {
487 _this.grid.footer.onClick('first');