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] );
315 for (var kk in r.relates_to_schema) {
316 var rr = r.relates_to_schema[kk];
317 if (rr.Field == r.relates_to_col) {
320 ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );
325 alert("IPC:TEST:" + JSON.stringify(ar));
326 this.grid.dataSource.loadData(ar);
329 tableName : 'core_enum',
330 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
331 title : _this._strings['c671c787b49f50a3ace9fdc5bd597825'],
334 // convert the selected cells into a BJS data ready to send back to the UI..
337 this.firstTxtCol = "XXX";
342 var formElements = [];
343 this.grid.dataSource.each(function(rec) {
344 if (!rec.data.active) {
349 fieldLabel : rec.data.title,
350 name : rec.data.dataIndex,
351 width : 200, //row.type == 'string' ? 200 : 75,
353 xtype : rec.data.ftype
356 formElements.push(el);
358 formHeight += rec.data.ftype == 'TextArea' ? 100 : 30;
373 "|actioncomplete" : "function(_self,action)\n"+
375 " if (action.type == 'setdata') {\n"+
376 " //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
379 " if (action.type == 'load') {\n"+
382 " if (action.type =='submit') {\n"+
384 " _this.dialog.hide();\n"+
386 " if (_this.callback) {\n"+
387 " _this.callback.call(_this, action.result.data);\n"+
389 " _this.form.reset();\n"+
394 "|rendered" : "function (form)\n"+
396 " _this.form= form;\n"+
400 style : "margin:10px;",
401 "|url" : "baseURL + '/Roo/" + this.table + "'",
406 alert("IPC:OUT:" + JSON.stringify({
408 "collapsible": false,
409 "height": formHeight,
411 "title": "Edit / Create " + this.table,
414 "xtype": "LayoutDialog",
419 "xtype": "LayoutRegion",
424 "xtype": "ContentPanel",
433 "click": "function (_self, e)\n{\n _this.dialog.hide();\n}"
435 "*prop": "buttons[]",
442 "click": "function (_self, e)\n{\n // do some checks?\n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}"
444 "*prop": "buttons[]",
459 activate : function() {
462 _this.grid.footer.onClick('first');