"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 alert(\"IPC:TEST:\" + JSON.stringify({ x: 5, y: 6 },null,4));\n return;\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 , 'TextField', r.Field + '_display_name'] );\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 loadData" : "function(data) { \n\n //alert(\"IPC:TEST:\" + JSON.stringify(data,null,4));\n alert(\"IPC:TEST:\" + JSON.stringify({ x: 5, y: 6 },null,4));\n return;\n \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 , 'TextField', r.Field + '_display_name'] );\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 return;\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 : 200, //row.type == 'string' ? 200 : 75,\n '|xns' : 'Roo.form',\n xtype : rec.data.ftype\n }\n if (xtype == 'DateField') {\n el.format = 'Y-m-d';\n el.useIso = true;\n el.width = 100;\n }\n \n if (xtype == 'TextArea') {\n el.height = 100;\n }\n \n if (xtype == 'Hidden') {\n delete el.fieldLabel;\n delete el.width;\n }\n if (xtype == 'Combobox') {\n \n\n el.queryParam = 'query[' + combofields_name + ']';// SET WHEN USED\n \n el.hiddenName = old.name; // SET WHEN USED eg. project_id\n el.displayField = combofields_name; // SET WHEN USED eg. project_id\n el.name = old.name + '_' + combofields_name; // SET WHEN USED eg. project_id_name\n el.tpl = '<div class=\"x-grid-cell-text x-btn button\"><b>{' + combofields_name +'}</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/\" + reftable + \".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 \n formElements.push(el);\n \n formHeight += rec.data.ftype == 'TextArea' ? 100 : 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,
{
"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}"
+ "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}",
+ "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n\n}"
},
"Number clicksToEdit" : 1,
"autoExpandColumn" : "title",
},
{
"xtype" : "ColumnModel",
- "width" : 75,
"header" : "Use ",
+ "width" : 75,
"$ renderer" : "function(v) { \n var state = v *1 > 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
},
{
"xtype" : "ColumnModel",
- "header" : "Database Column",
"width" : 150,
+ "header" : "Database Column",
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
},
{
"xtype" : "ColumnModel",
- "width" : 100,
"header" : "Type",
+ "width" : 100,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
},
{
"xtype" : "ColumnModel",
- "header" : "Label",
"width" : 120,
+ "header" : "Label",
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
},
{
"xtype" : "ColumnModel",
- "width" : 120,
"header" : "Field Type",
+ "width" : 120,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
},
{
"xtype" : "ColumnModel",
- "header" : "Display Field",
"width" : 150,
+ "header" : "Display Field",
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
},
{
"xtype" : "ColumnModel",
- "width" : 75,
"header" : "Width",
+ "width" : 75,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",