"| 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 var formHeight = 50;\n \n var jreader = {};\n var formElements = [];\n this.grid.dataSource.each(function(rec) {\n if (!rec.data.active) {\n return;\n }\n \n var el = {\n fieldLabel : rec.data.title,\n name : rec.data.dataIndex,\n width : rec.data.width,\n '|xns' : 'Roo.form',\n xtype : rec.data.ftype\n }\n if (el.xtype == 'DateField') {\n el.format = 'Y-m-d';\n el.useIso = true;\n el.width = 100;\n }\n \n if (el.xtype == 'TextArea') {\n el.height = 100;\n }\n \n if (el.xtype == 'Hidden') {\n delete el.fieldLabel;\n delete el.width;\n }\n \n if (el.xtype == 'ComboBox') {\n \n el.alwaysQuery = true;\n el.triggerAction = 'all';\n el.forceSelection = true;\n el.selectOnFocus = true;\n el.minChars = 2;\n el.editable = true;\n el.emptyText = 'Select a value';\n \n \n el.queryParam = 'query[' + rec.data.display_field + ']';// SET WHEN USED\n \n el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id\n el.name = rec.data.dataIndex + '_' + rec.data.display_field; // SET WHEN USED eg. project_id_name\n \n el.displayField = rec.data.display_field // SET WHEN USED eg. project_id\n el.valueField = rec.data.relates_to_col \n \n el.tpl = '<div class=\"x-grid-cell-text x-btn button\"><b>{' + rec.data.display_field +'}</b> </div>'; // SET WHEN USED\n \n \n el.items = [\n {\n \n '*prop' : 'store',\n 'xtype' : 'Store',\n '|xns' : 'Roo.data',\n 'remoteSort' : true,\n '|sortInfo' : '{ direction : \\'ASC\\', field: \\'id\\' }',\n listeners : {\n '|beforeload' : 'function (_self, o)' +\n \"{\\n\" +\n \" o.params = o.params || {};\\n\" +\n \" // set more here\\n\" +\n \"}\\n\"\n },\n items : [\n {\n '*prop' : 'proxy',\n 'xtype' : 'HttpProxy',\n 'method' : 'GET',\n '|xns' : 'Roo.data',\n '|url' : \"baseURL + '/Roo/\" + rec.data.relates_to_table + \".php'\",\n },\n \n {\n '*prop' : 'reader',\n 'xtype' : 'JsonReader',\n '|xns' : 'Roo.data',\n 'id' : 'id',\n 'root' : 'data',\n 'totalProperty' : 'total'\n\n \n }\n ]\n }\n ];\n \n }\n \n if (el.xtype == 'ComboBoxArray') {\n \n el.hiddenName = rec.data.dataIndex;\n el.name = rec.data.dataIndex + '_' + rec.data.display_field;\n \n el.items = [\n {\n 'alwaysQuery' : true,\n 'triggerAction' : 'all',\n 'forceSelection': true,\n 'selectOnFocus' : true,\n 'minChars' :2,\n 'editable' : true,\n 'emptyText' : 'Select a value',\n 'displayField' : rec.data.display_field,\n 'valueField' : rec.data.relates_to_col,\n 'xtype' : 'ComboBox',\n '$ xns' : 'Roo.form',\n '* prop' : 'combo',\n 'queryParam' : 'query[' + rec.data.display_field + ']',\n 'tpl' : '<div class=\"x-grid-cell-text x-btn button\"><b>{' + rec.data.display_field +'}</b> </div>',\n \n items : [\n {\n '*prop' : 'store',\n 'xtype' : 'Store',\n '|xns' : 'Roo.data',\n 'remoteSort' : true,\n '|sortInfo' : '{ direction : \\'ASC\\', field: \\'id\\' }',\n listeners : {\n '|beforeload' : 'function (_self, o)' +\n \"{\\n\" +\n \" o.params = o.params || {};\\n\" +\n \" // set more here\\n\" +\n \"}\\n\"\n },\n items : [\n {\n '*prop' : 'proxy',\n 'xtype' : 'HttpProxy',\n 'method' : 'GET',\n '|xns' : 'Roo.data',\n '|url' : \"baseURL + '/Roo/\" + rec.data.relates_to_table + \".php'\",\n },\n {\n '*prop' : 'reader',\n 'xtype' : 'JsonReader',\n '|xns' : 'Roo.data',\n 'id' : 'id',\n 'root' : 'data',\n 'totalProperty' : 'total'\n }\n \n ]\n }\n ]\n }\n ];\n }\n \n if (el.xtype == 'HtmlEditor') {\n el.height = 250,\n el.resizable = 's',\n el.items = [\n {\n '* prop' : 'toolbars[]',\n '|xns' : 'Roo.form.HtmlEditor',\n 'xtype' : 'ToolbarContext'\n },\n {\n '* prop' : 'toolbars[]',\n '|xns' : 'Roo.form.HtmlEditor',\n 'xtype' : 'ToolbarStandard'\n\n }\n ]\n }\n \n formElements.push(el);\n \n formHeight += rec.data.ftype == 'TextArea' ? 100 : ((rec.data.ftype == 'HtmlEditor') ? 250 : 30);\n \n \n });\n \n \n \n \n \n \n var frmCfg = \n {\n '|xns' : 'Roo.form',\n xtype : \"Form\",\n listeners : {\n \"|actioncomplete\" : \"function(_self,action)\\n\"+\n \"{\\n\"+\n \" if (action.type == 'setdata') {\\n\"+\n \" //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\\n\"+\n \" return;\\n\"+\n \" }\\n\"+\n \" if (action.type == 'load') {\\n\"+\n \" return;\\n\"+\n \" }\\n\"+\n \" if (action.type =='submit') {\\n\"+\n \" \\n\"+\n \" _this.dialog.hide();\\n\"+\n \" \\n\"+\n \" if (_this.callback) {\\n\"+\n \" _this.callback.call(_this, action.result.data);\\n\"+\n \" }\\n\"+\n \" _this.form.reset();\\n\"+\n \" return;\\n\"+\n \" }\\n\"+\n \"}\\n\",\n \n \"|rendered\" : \"function (form)\\n\"+\n \"{\\n\"+\n \" _this.form= form;\\n\"+\n \"}\\n\"\n },\n method : \"POST\",\n style : \"margin:10px;\",\n \"|url\" : \"baseURL + '/Roo/\" + this.table + \"'\",\n items : formElements\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,
"| 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 var formHeight = 50;\n \n var jreader = {};\n var formElements = [];\n this.grid.dataSource.each(function(rec) {\n if (!rec.data.active) {\n return;\n }\n \n var el = {\n fieldLabel : rec.data.title,\n name : rec.data.dataIndex,\n width : rec.data.width,\n '|xns' : 'Roo.form',\n xtype : rec.data.ftype\n }\n if (el.xtype == 'DateField') {\n el.format = 'Y-m-d';\n el.useIso = true;\n el.width = 100;\n }\n \n if (el.xtype == 'TextArea') {\n el.height = 100;\n }\n \n if (el.xtype == 'Hidden') {\n delete el.fieldLabel;\n delete el.width;\n }\n \n if (el.xtype == 'ComboBox') {\n \n el.alwaysQuery = true;\n el.triggerAction = 'all';\n el.forceSelection = true;\n el.selectOnFocus = true;\n el.minChars = 2;\n el.editable = true;\n el.emptyText = 'Select a value';\n \n \n el.queryParam = 'query[' + rec.data.display_field + ']';// SET WHEN USED\n \n el.hiddenName = rec.data.dataIndex // SET WHEN USED eg. project_id\n el.name = rec.data.dataIndex + '_' + rec.data.display_field; // SET WHEN USED eg. project_id_name\n \n el.displayField = rec.data.display_field // SET WHEN USED eg. project_id\n el.valueField = rec.data.relates_to_col \n \n el.tpl = '<div class=\"x-grid-cell-text x-btn button\"><b>{' + rec.data.display_field +'}</b> </div>'; // SET WHEN USED\n \n \n el.items = [\n {\n \n '*prop' : 'store',\n 'xtype' : 'Store',\n '|xns' : 'Roo.data',\n 'remoteSort' : true,\n '|sortInfo' : '{ direction : \\'ASC\\', field: \\'id\\' }',\n listeners : {\n '|beforeload' : 'function (_self, o)' +\n \"{\\n\" +\n \" o.params = o.params || {};\\n\" +\n \" // set more here\\n\" +\n \"}\\n\"\n },\n items : [\n {\n '*prop' : 'proxy',\n 'xtype' : 'HttpProxy',\n 'method' : 'GET',\n '|xns' : 'Roo.data',\n '|url' : \"baseURL + '/Roo/\" + rec.data.relates_to_table + \".php'\",\n },\n \n {\n '*prop' : 'reader',\n 'xtype' : 'JsonReader',\n '|xns' : 'Roo.data',\n 'id' : 'id',\n 'root' : 'data',\n 'totalProperty' : 'total'\n\n \n }\n ]\n }\n ];\n \n }\n \n if (el.xtype == 'ComboBoxArray') {\n \n el.hiddenName = rec.data.dataIndex;\n el.name = rec.data.dataIndex + '_' + rec.data.display_field;\n \n el.items = [\n {\n 'alwaysQuery' : true,\n 'triggerAction' : 'all',\n 'forceSelection': true,\n 'selectOnFocus' : true,\n 'minChars' :2,\n 'editable' : true,\n 'emptyText' : 'Select a value',\n 'displayField' : rec.data.display_field,\n 'valueField' : rec.data.relates_to_col,\n 'xtype' : 'ComboBox',\n '$ xns' : 'Roo.form',\n '* prop' : 'combo',\n 'queryParam' : 'query[' + rec.data.display_field + ']',\n 'tpl' : '<div class=\"x-grid-cell-text x-btn button\"><b>{' + rec.data.display_field +'}</b> </div>',\n \n items : [\n {\n '*prop' : 'store',\n 'xtype' : 'Store',\n '|xns' : 'Roo.data',\n 'remoteSort' : true,\n '|sortInfo' : '{ direction : \\'ASC\\', field: \\'id\\' }',\n listeners : {\n '|beforeload' : 'function (_self, o)' +\n \"{\\n\" +\n \" o.params = o.params || {};\\n\" +\n \" // set more here\\n\" +\n \"}\\n\"\n },\n items : [\n {\n '*prop' : 'proxy',\n 'xtype' : 'HttpProxy',\n 'method' : 'GET',\n '|xns' : 'Roo.data',\n '|url' : \"baseURL + '/Roo/\" + rec.data.relates_to_table + \".php'\",\n },\n {\n '*prop' : 'reader',\n 'xtype' : 'JsonReader',\n '|xns' : 'Roo.data',\n 'id' : 'id',\n 'root' : 'data',\n 'totalProperty' : 'total'\n }\n \n ]\n }\n ]\n }\n ];\n }\n \n if (el.xtype == 'HtmlEditor') {\n el.height = 250,\n el.resizable = 's',\n el.items = [\n {\n '* prop' : 'toolbars[]',\n '|xns' : 'Roo.form.HtmlEditor',\n 'xtype' : 'ToolbarContext'\n },\n {\n '* prop' : 'toolbars[]',\n '|xns' : 'Roo.form.HtmlEditor',\n 'xtype' : 'ToolbarStandard'\n\n }\n ]\n }\n \n formElements.push(el);\n \n formHeight += rec.data.ftype == 'TextArea' ? 100 : ((rec.data.ftype == 'HtmlEditor') ? 250 : 30);\n \n \n });\n \n \n \n \n \n \n var frmCfg = \n {\n '|xns' : 'Roo.form',\n xtype : \"Form\",\n listeners : {\n \"|actioncomplete\" : \"function(_self,action)\\n\"+\n \"{\\n\"+\n \" if (action.type == 'setdata') {\\n\"+\n \" //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\\n\"+\n \" return;\\n\"+\n \" }\\n\"+\n \" if (action.type == 'load') {\\n\"+\n \" return;\\n\"+\n \" }\\n\"+\n \" if (action.type =='submit') {\\n\"+\n \" \\n\"+\n \" _this.dialog.hide();\\n\"+\n \" \\n\"+\n \" if (_this.callback) {\\n\"+\n \" _this.callback.call(_this, action.result.data);\\n\"+\n \" }\\n\"+\n \" _this.form.reset();\\n\"+\n \" return;\\n\"+\n \" }\\n\"+\n \"}\\n\",\n \n \"|rendered\" : \"function (form)\\n\"+\n \"{\\n\"+\n \" _this.form= form;\\n\"+\n \"}\\n\"\n },\n method : \"POST\",\n style : \"margin:10px;\",\n \"|url\" : \"baseURL + '/Roo/\" + this.table + \"'\",\n items : formElements\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,