{
- "id": "roo-file-231",
+ "id": "roo-file-184",
"name": "Pman.Dialog.BuilderAddTable",
"parent": "",
"title": "",
- "path": "/home/alan/gitlive/Pman.Builder/Pman.Dialog.BuilderAddTable.bjs",
+ "path": "/home/edward/gitlive/Pman.Builder/Pman.Dialog.BuilderAddTable.bjs",
"items": [
{
"listeners": {
"closable": false,
"collapsible": false,
"height": 500,
+ "modal": true,
"resizable": false,
"title": "Select columns to use",
- "width": 700,
+ "width": 900,
"xtype": "LayoutDialog",
"|xns": "Roo",
"items": [
},
"*prop": "grid",
"autoExpandColumn": "desc",
+ "clicksToEdit": 1,
"loadMask": true,
- "xtype": "Grid",
+ "xtype": "EditorGrid",
"|xns": "Roo.grid",
"items": [
{
"listeners": {
"beforeload": "function (_self, options)\n{\n if (typeof(_this.data) == 'undefined') {\n return false;\n \n }\n options.params = options.params || {};\n options.params.table = _this.data.table;\n}",
- "load": "function (_self, records, options)\n{\n // after load, if we have configuration already, overlay that \n \n \n}"
+ "load": "function (_self, records, options)\n{\n // after load, if we have configuration already, overlay that \n if (typeof(_this.data.cols) == 'undefined') {\n return;\n }\n _this.data.cols_ex = _this.data.cols_ex || [];\n var cmap = {}\n Roo.each(_this.data.cols, function (col) {\n cmap[col.column] = col;\n \n });\n Roo.each(records, function (col) {\n col.set('use_ex', _this.data.cols_ex.indexOf(col.data.column) > -1 ? 1 : 0);\n\n if (typeof(cmap[col.data.column]) != 'undefined') {\n\n col.set('title', typeof(cmap[col.data.column].title) == 'undefined' ? '' : cmap[col.data.column].title);\n col.set('use', 1);\n }\n if (!col.data.title.length) {\n \n if (col.data.columnshort.substring(0, col.data.table.length) == col.data.table) {\n // it's prefixed with table name..\n col.set('title', col.data.columnshort.substring(col.data.table.length+1));\n } else {\n col.set('title', col.data.columnshort);\n }\n } \n \n\n // what about descption..\n });\n \n \n \n}"
},
"*prop": "dataSource",
"remoteSort": true,
"root": "data",
"totalProperty": "total",
"xtype": "JsonReader",
- "|fields": "[\n { name: 'use', type: 'int'} , \n { name: 'use_ex', type: 'int'}, \n 'table', 'column', 'ctype', 'desc', 'columnshort'\n]",
+ "|fields": "[\n { name: 'use', type: 'int'} , \n { name: 'use_ex', type: 'int'}, \n 'table', 'column', 'ctype', 'desc', 'columnshort', 'title'\n]",
"|xns": "Roo.data"
}
]
},
{
"*prop": "colModel[]",
- "dataIndex": "table",
- "header": "Table",
- "width": 100,
+ "dataIndex": "column",
+ "header": "Column",
+ "width": 150,
"xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('{0}', v); }",
+ "|renderer": "function(v,x,r) { \n if (r.data.table == _this.data.table) {\n \n return String.format('<B>{0}</B>', v); \n }\n return String.format('{0}...{1}', r.data.table, r.data.columnshort); \n}",
"|xns": "Roo.grid"
},
{
"*prop": "colModel[]",
- "dataIndex": "column",
- "header": "Column",
+ "dataIndex": "title",
+ "header": "Title",
"width": 150,
"xtype": "ColumnModel",
- "|renderer": "function(v,x,r) { \n if (r.data.table == _this.data.table) {\n \n return String.format('{0}', v); \n }\n return String.format('.....{0}', r.data.columnshort); \n}",
- "|xns": "Roo.grid"
+ "|renderer": "function(v,x,r) { \n \n var u = r.data.use * 1;\n u += (r.data.use_ex*1);\n \n return String.format('{0}', u ? v : ''); \n}",
+ "|xns": "Roo.grid",
+ "items": [
+ {
+ "|xns": "Roo.grid",
+ "xtype": "GridEditor",
+ "*prop": "editor",
+ "items": [
+ {
+ "|xns": "Roo.form",
+ "xtype": "TextField",
+ "*prop": "field"
+ }
+ ]
+ }
+ ]
},
{
"*prop": "colModel[]",
},
{
"listeners": {
- "click": "function (_self, e)\n{\n var ret = Roo.apply({ cols : [], cols_ex: [] }, _this.data);\n \n _this.grid.ds.each(function(r) {\n \n if (r.data.use*1) {\n ret.cols.push(r.data);\n }\n if (r.data.use_ex*1) {\n ret.cols_ex.push( r.data.column );\n }\n\n });\n \n if (!ret.cols_ex.length) {\n Roo.MessageBox.alert(\"Error\", \"Select at least one Display/expand col\");\n return;\n }\n Roo.log(ret);\n _this.callback(ret);\n _this.dialog.hide();\n\n}"
+ "click": "function (_self, e)\n{\n var ret = Roo.applyIf({ cols : [], cols_ex: [] }, _this.data);\n \n _this.grid.ds.each(function(r) {\n \n if (r.data.use*1) {\n \n var d = Roo.apply({}, r.json);\n Roo.apply(d, r.data);\n ret.cols.push(d);\n \n }\n if (r.data.use_ex*1) {\n ret.cols_ex.push( r.data.column );\n }\n\n });\n \n if (!ret.cols_ex.length) {\n Roo.MessageBox.alert(\"Error\", \"Select at least one Display/expand col\");\n return;\n }\n Roo.log(ret);\n\n _this.dialog.hide();\n _this.callback(ret);\n \n\n}"
},
"*prop": "buttons[]",
"text": "Next",