{ "name" : "Editor.Roo.LayoutDialog", "parent" : "", "title" : "", "path" : "/home/alan/gitlive/app.Builder.js/resources/Editors/Editor.Roo.LayoutDialog.bjs", "permname" : "", "modOrder" : "001", "strings" : { "b021df6aac4654c454f46c77646e745f" : "Label", "793548e77e782c209a78ed67f255b5e2" : "Display Field", "4ce58cbe362a5d7b156992a496d55bf3" : "Database Column", "189efd19c4153526994a6d7ea5f6f068" : "Field Type", "2f616612593df62aeed112de4f03110e" : "Edit a Grid", "0ccc2bf3fb98387c23b6ca5500244d6e" : "Use ", "c671c787b49f50a3ace9fdc5bd597825" : "core_enum", "32954654ac8fe66a1d09be19001de2d4" : "Width", "a1fa27779242b4902f7ae3bdd5c6d508" : "Type", "6e7376dca68a2386a8737944196ab491" : "Create / Edit Grid" }, "items" : [ { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "| function loadData" : "function(data) { \n\n alert(\"IPC:TEST:\" + JSON.stringify(data,null,4));\n var ar = [];\n for (var k in data) { \n var r = data[k];\n var has_s = typeof(r.relates_to_schema) != 'undefined'\n ar.push([ !has_s , r.Field, r.Type, r.Field, 100] );\n if (!has_s) {\n continue;\n }\n /*\n for (var kk in r.relates_to_schema) { \n var rr = r.relates_to_schema[kk];\n if (rr.Field == r.relates_to_col) {\n continue;\n }\n ar.push([ false, r.Field + '_'+ rr.Field, rr.Type, rr.Field, 100] );\n }\n */\n }\n this.schema = data;\n alert(\"IPC:TEST:\" + JSON.stringify(ar));\n this.grid.dataSource.loadData(ar);\n}", "| function toBJS" : "function() { \n\n// convert the selected cells into a BJS data ready to send back to the UI..\n \n this.table = \"XXX\";\n this.firstTxtCol = \"XXX\";\n \n \n var jreader = {};\n var colmodel = [];\n this.grid.dataSource.each(function(rec) {\n if (!rec.data.active) {\n return;\n }\n \n \n \n colmodel.push({\n \"xtype\": \"ColumnModel\",\n \"header\": rec.data.title,\n \"width\": rec.data.width * 1,\n \"dataIndex\": rec.data.dataIndex,\n \"|renderer\": !rec.data.type.match(/date/i) ? \n \"function(v) { return String.format('{0}', v); }\" :\n \"function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }\" , // special for date\n \"|xns\": \"Roo.grid\",\n \"*prop\": \"cm[]\"\n });\n });\n \n \n \n\n alert(\"IPC:OUT:\" + JSON.stringify({\n \"closable\": false,\n \"collapsible\": false,\n \"height\": formHeight,\n \"resizable\": false,\n \"title\": \"Edit / Create \" + this.table,\n \"width\": 400,\n \"modal\" : true,\n \"xtype\": \"LayoutDialog\",\n \"|xns\": \"Roo\",\n \"items\": [\n {\n \"|xns\": \"Roo\",\n \"xtype\": \"LayoutRegion\",\n \"*prop\": \"center\"\n },\n {\n \"region\": \"center\",\n \"xtype\": \"ContentPanel\",\n \"|xns\": \"Roo\",\n \"items\": [\n frmCfg\n ]\n },\n \n {\n \"listeners\": {\n \"click\": \"function (_self, e)\\n{\\n _this.dialog.hide();\\n}\"\n },\n \"*prop\": \"buttons[]\",\n \"text\": \"Cancel\",\n \"xtype\": \"Button\",\n \"|xns\": \"Roo\"\n },\n {\n \"listeners\": {\n \"click\": \"function (_self, e)\\n{\\n // do some checks?\\n \\n \\n _this.dialog.el.mask(\\\"Saving\\\");\\n _this.form.doAction(\\\"submit\\\");\\n\\n}\"\n },\n \"*prop\": \"buttons[]\",\n \"text\": \"Save\",\n \"xtype\": \"Button\",\n \"|xns\": \"Roo\"\n }\n ]\n \n \n \n }, null, 4));\n\n}", "fitToframe" : true, "background" : false, "region" : "center", "title" : "core_enum", "xtype" : "GridPanel", "$ xns" : "Roo", "fitContainer" : true, "String title" : "Create / Edit Grid", "tableName" : "core_enum", "items" : [ { "listeners" : { "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n \n}\n", "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n\n}", "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n\n var di = this.colModel.getDataIndex(columnIndex);\n if (di != 'active') {\n return;\n }\n \n var rec = _this.grid.ds.getAt(rowIndex);\n \n rec.set('active', rec.data.active * 1 ? 0 : 1);\n rec.commit();\n \n \n}" }, "Number clicksToEdit" : 1, "autoExpandColumn" : "title", "xtype" : "EditorGrid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "$ Array fields" : "[ 'active', 'dataIndex', 'type','title', 'width' ]", "$ Array data" : "[\n [ 1, 'test', 'test', 110 ]\n \n\n]", "Number id" : "'dataIndex'", "xtype" : "SimpleStore", "$ xns" : "Roo.data", "* prop" : "ds" }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "string text" : "Edit a Grid", "xtype" : "TextItem", "$ xns" : "Roo.Toolbar" } ] }, { "xtype" : "ColumnModel", "width" : 75, "header" : "Use ", "$ renderer" : "function(v) { \n var state = v *1 > 0 ? '-checked' : '';\n\n return '';\n \n }", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "active" }, { "xtype" : "ColumnModel", "header" : "Database Column", "width" : 150, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "dataIndex" }, { "xtype" : "ColumnModel", "width" : 100, "header" : "Type", "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "type" }, { "xtype" : "ColumnModel", "header" : "Label", "width" : 75, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "title", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "xtype" : "TextField", "$ xns" : "Roo.form", "* prop" : "field" } ] } ] }, { "xtype" : "ColumnModel", "width" : 75, "header" : "Field Type", "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "ftype", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "listWidth" : 200, "triggerAction" : "all", "displayField" : "fname", "hiddenName" : "status", "valueField" : "ftype", "xtype" : "ComboBox", "allowBlank" : false, "editable" : false, "width" : 150, "$ xns" : "Roo.form", "mode" : "local", "name" : "status", "* prop" : "field", "items" : [ { "xtype" : "SimpleStore", "$ data" : "[ \n [ 'ComboBox', \"ComboBox\"],\n [ 'Text' , \"TextField\"],\n [ 'Number', \"NumberField\"],\n [ 'TextArea', \"TextArea\"],\n [ 'Html', \"HtmlEntry\"]\n \n]\n", "$ fields" : "[ 'ftype', 'fname']", "$ xns" : "Roo.data", "* prop" : "store" } ] } ] } ] }, { "xtype" : "ColumnModel", "header" : "Display Field", "width" : 75, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "ftype", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "listWidth" : 200, "triggerAction" : "all", "displayField" : "fname", "hiddenName" : "status", "valueField" : "ftype", "xtype" : "ComboBox", "allowBlank" : false, "editable" : false, "width" : 150, "$ xns" : "Roo.form", "mode" : "local", "name" : "status", "* prop" : "field", "items" : [ { "xtype" : "SimpleStore", "$ data" : "[ \n [ 'ComboBox', \"ComboBox\"],\n [ 'Text' , \"TextField\"],\n [ 'Number', \"NumberField\"],\n [ 'TextArea', \"TextArea\"],\n [ 'Html', \"HtmlEntry\"]\n \n]\n", "$ fields" : "[ 'ftype', 'fname']", "$ xns" : "Roo.data", "* prop" : "store" } ] } ] } ] }, { "xtype" : "ColumnModel", "width" : 75, "header" : "Width", "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "cm[]", "dataIndex" : "width", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "xtype" : "NumberField", "Number decimalPrecision" : 0, "$ xns" : "Roo.form", "* prop" : "field" } ] } ] } ] } ] } ] }