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 '4ce58cbe362a5d7b156992a496d55bf3' :"Database Column",
12 '2f616612593df62aeed112de4f03110e' :"Edit a Grid",
13 '0ccc2bf3fb98387c23b6ca5500244d6e' :"Use ",
14 'c671c787b49f50a3ace9fdc5bd597825' :"core_enum",
15 '32954654ac8fe66a1d09be19001de2d4' :"Width",
16 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
17 '6e7376dca68a2386a8737944196ab491' :"Create / Edit Grid",
18 '7fc56270e7a70fa81a5935b72eacbe29' :"A"
21 part : ["Editors", "LayoutDialog" ],
22 order : '001-Editor.Roo.LayoutDialog',
25 name : "unnamed module",
37 [ 1, 'test', 'test', 110 ]
41 fields : [ 'active', 'dataIndex', 'type','title', 'width' ],
52 '|xns' : 'Roo.Toolbar',
53 text : _this._strings['2f616612593df62aeed112de4f03110e'],
61 autoExpandColumn : 'title',
70 header : _this._strings['0ccc2bf3fb98387c23b6ca5500244d6e'],
71 renderer : function(v) {
72 var state = v *1 > 0 ? '-checked' : '';
74 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
83 dataIndex : 'dataIndex',
84 header : _this._strings['4ce58cbe362a5d7b156992a496d55bf3'],
85 renderer : function(v) { return String.format('{0}', v); },
93 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
94 renderer : function(v) { return String.format('{0}', v); },
108 xtype : 'GridEditor',
116 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
117 renderer : function(v) { return String.format('{0}', v); },
120 xtype : 'ColumnModel',
132 [ 'ComboBox', "ComboBox"],
133 [ 'Text' , "TextField"],
134 [ 'Number', "NumberField"],
135 [ 'TextArea', "TextArea"],
136 [ 'Html', "HtmlEntry"]
139 fields : [ 'ftype', 'fname'],
141 xtype : 'SimpleStore'
145 displayField : 'fname',
147 hiddenName : 'status',
151 triggerAction : 'all',
152 value : _this._strings['7fc56270e7a70fa81a5935b72eacbe29'],
153 valueField : 'ftype',
164 xtype : 'GridEditor',
172 header : _this._strings['b021df6aac4654c454f46c77646e745f'],
173 renderer : function(v) { return String.format('{0}', v); },
176 xtype : 'ColumnModel',
186 decimalPrecision : 0,
188 xtype : 'NumberField'
192 xtype : 'GridEditor',
200 header : _this._strings['32954654ac8fe66a1d09be19001de2d4'],
201 renderer : function(v) { return String.format('{0}', v); },
204 xtype : 'ColumnModel',
212 cellclick : function (_self, rowIndex, columnIndex, e)
215 var di = this.colModel.getDataIndex(columnIndex);
216 if (di != 'active') {
220 var rec = _this.grid.ds.getAt(rowIndex);
222 rec.set('active', rec.data.active * 1 ? 0 : 1);
230 //_this.dialog = Pman.Dialog.FILL_IN
233 rowdblclick : function (_self, rowIndex, e)
235 if (!_this.dialog) return;
248 loadData : function(data) {
250 alert("IPC:TEST:" + JSON.stringify(data,null,4));
252 for (var k in data) {
254 var has_s = typeof(r.relates_to_schema) != 'undefined'
255 ar.push([ !has_s , r.Field, r.Type, r.Field, 100] );
259 for (var kk in r.relates_to_schema) {
260 var rr = r.relates_to_schema[kk];
261 if (rr.Field == r.relates_to_col) {
264 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
268 alert("IPC:TEST:" + JSON.stringify(ar));
269 this.grid.dataSource.loadData(ar);
272 tableName : 'core_enum',
273 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
274 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
277 // convert the selected cells into a BJS data ready to send back to the UI..
280 this.firstTxtCol = "XXX";
285 this.grid.dataSource.each(function(rec) {
286 if (!rec.data.active) {
293 "xtype": "ColumnModel",
294 "header": rec.data.title,
295 "width": rec.data.width * 1,
296 "dataIndex": rec.data.dataIndex,
297 "|renderer": !rec.data.type.match(/date/i) ?
298 "function(v) { return String.format('{0}', v); }" :
299 "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }" , // special for date
308 alert("IPC:OUT:" + JSON.stringify({
313 "fitContainer": true,
314 "tableName": this.table,
318 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
324 "autoExpandColumn": this.firstTxtCol,
327 "|render": "function() \n" +
329 " _this.grid = this; \n" +
330 " //_this.dialog = Pman.Dialog.FILL_IN\n" +
331 " if (_this.panel.active) {\n" +
332 " this.footer.onClick('first');\n" +
335 "|rowdblclick": "function (_self, rowIndex, e)\n" +
337 " if (!_this.dialog) return;\n" +
338 " _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n" +
339 " _this.grid.footer.onClick('first');\n" +
347 "*prop": "dataSource",
350 '|sortInfo' : "{ field : '" + this.firstTxtCol + "', direction: 'ASC' }",
356 "xtype": "HttpProxy",
358 "|url": "baseURL + '/Roo/" + this.table + ".php'",
363 'xtype' : 'JsonReader',
367 'totalProperty' : 'total'
373 "xtype": "PagingToolbar",
376 "displayMsg": "Displaying " + this.table + "{0} - {1} of {2}",
377 "emptyMsg": "No " + this.table + " found",
388 "cls": "x-btn-text-icon",
389 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
391 "|click": "function()\n"+
393 " if (!_this.dialog) return;\n" +
394 " _this.dialog.show( { id : 0 } , function() {\n"+
395 " _this.grid.footer.onClick('first');\n"+
399 "|xns": "Roo.Toolbar"
404 "cls": "x-btn-text-icon",
405 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
408 "|click": "function()\n"+
410 " Pman.genericDelete(_this, '" + this.table + "'); \n"+
414 "|xns": "Roo.Toolbar"
429 activate : function() {
432 _this.grid.footer.onClick('first');