resources/Editors/Editor.Roo.LayoutDialog.bjs
[app.Builder.js] / resources / Editors / Editor.Roo.LayoutDialog.bjs
1 {
2  "name" : "Editor.Roo.LayoutDialog",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/app.Builder.js/resources/Editors/Editor.Roo.LayoutDialog.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "b021df6aac4654c454f46c77646e745f" : "Label",
10   "793548e77e782c209a78ed67f255b5e2" : "Display Field",
11   "040076bde7f6b3387448e32b66c2eee0" : "To BJS",
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",
20   "f541774a08fc687f6e2016c77a6ebca5" : "Load Data"
21  },
22  "items" : [
23   {
24    "listeners" : {
25     "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
26    },
27    "| function loadData" : "function(data) { \n\n    //alert(\"IPC:TEST:\" + JSON.stringify(data,null,4));\n\n    var fields = _this.grid.dataSource.reader.recordType.prototype.fields;\n    \n    \n    var d = [];\n\n    for (var k in data) { \n        var r = data[k];\n        var has_s = typeof(r.relates_to_schema) != 'undefined';\n        \n        Roo.log(r.Type);\n        var field_type = 'TextField';\n        \n        if (r.Type == 'text'){\n            field_type = 'TextArea';\n        }\n        \n        if(r.Type == 'date' || r.Type == 'datetime'){\n            field_type = 'DateField';\n        }\n            \n        var regex = /(.*?)\\((.*?)\\)/;\n        \n        if(regex.test(r.Type)){\n            var type_match = regex.exec(r.Type);\n            \n            if(type_match[1] == 'int'){\n                field_type = 'NumberField';\n                    \n                if(type_match[2] * 1  < 11){\n                    field_type = 'CheckBox';\n                }\n            }\n        } \n        \n        var rt = '', rc = '', rs = [];\n        \n        if(has_s){\n            for (var kk in r.relates_to_schema) {         \n                var rr = r.relates_to_schema[kk];\n                \n                rt = r.relates_to_table;\n                rc = r.relates_to_col;\n                \n                rs.push([rr.Field]);\n                \n            }\n            \n            field_type = 'ComboBox';\n        }\n        \n        if(r.Field == 'id'){ // usually 'id' is hidden on the form\n            field_type = 'Hidden';\n        }\n        \n        \n        \n        var o = {\n            active : !has_s,\n            dataIndex : r.Field,\n            type : r.Type,\n            title : r.Field,\n            width : 200,\n            ftype : field_type,\n            display_field : rc, //r.Field + '_display_name',\n            relates_to_table : rt,\n            relates_to_col : rc,\n            relates_to_schema : rs\n        };\n        \n        d.push(o);\n        \n    }\n\n    var ar = [];\n    \n    Roo.each(d, function(dd){\n\n        var a = [];\n        \n        for(var j = 0; j < fields.length; j++){\n            var f = fields.items[j];\n            \n            if(dd.hasOwnProperty(f.name)){\n                a.push(dd[f.name]);\n            }\n        }\n        \n        ar.push(a);\n    });\n    \n    this.schema = data;\n    \n    //alert(\"IPC:TEST:\" + JSON.stringify(ar));\n    this.grid.dataSource.loadData(ar);\n}",
28    "| 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\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                    '*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            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           \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}",
29    "fitToframe" : true,
30    "background" : false,
31    "region" : "center",
32    "title" : "core_enum",
33    "xtype" : "GridPanel",
34    "$ xns" : "Roo",
35    "fitContainer" : true,
36    "String title" : "Create / Edit Grid",
37    "tableName" : "core_enum",
38    "items" : [
39     {
40      "listeners" : {
41       "|rowdblclick" : "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n  \n}\n",
42       "beforeedit" : "function (e)\n{\n    Roo.log('before edit!!!');\n    Roo.log(e);\n    \n    if(e.field != 'display_field'){\n        return;\n    }\n    \n    _this.grid.colModel.getCellEditor(e.column, e.row).field.store.loadData(e.record.data.relates_to_schema);\n}",
43       "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}",
44       "|render" : "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n\n}"
45      },
46      "Number clicksToEdit" : 1,
47      "autoExpandColumn" : "title",
48      "xtype" : "EditorGrid",
49      "loadMask" : true,
50      "$ xns" : "Roo.grid",
51      "* prop" : "grid",
52      "items" : [
53       {
54        "$ Array fields" : "[ \n    'active', \n    'dataIndex', \n    'type',\n    'title', \n    'width', \n    'ftype', \n    'display_field',\n    'relates_to_table',\n    'relates_to_col',\n    'relates_to_schema'\n]",
55        "$ Array data" : "[\n  [ 1, 'test', 'test', 110 ]\n  \n\n]",
56        "Number id" : "'dataIndex'",
57        "xtype" : "SimpleStore",
58        "$ xns" : "Roo.data",
59        "* prop" : "ds"
60       },
61       {
62        "xtype" : "Toolbar",
63        "$ xns" : "Roo",
64        "* prop" : "toolbar",
65        "items" : [
66         {
67          "string text" : "Edit a Grid",
68          "xtype" : "TextItem",
69          "$ xns" : "Roo.Toolbar"
70         },
71         {
72          "xtype" : "Fill",
73          "$ xns" : "Roo.Toolbar"
74         },
75         {
76          "listeners" : {
77           "click" : "function (_self, e)\n{\n    var data = {    \n        \"manage_scale_id\": {\n            \"Field\": \"manage_scale_id\",\n            \"Type\": \"int(11)\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": \"0\",\n            \"Extra\": null,\n            \"relates_to_table\": \"core_enum\",\n            \"relates_to_col\": \"id\",\n            \"relates_to_schema\": {\n                \"id\": {\n                    \"Field\": \"id\",\n                    \"Type\": \"int(11)\",\n                    \"Null\": \"NO\",\n                    \"Key\": \"PRI\",\n                    \"Default\": null,\n                    \"Extra\": \"auto_increment\"\n                },\n                \"etype\": {\n                    \"Field\": \"etype\",\n                    \"Type\": \"varchar(32)\",\n                    \"Null\": \"NO\",\n                    \"Key\": null,\n                    \"Default\": null,\n                    \"Extra\": null\n                },\n                \"name\": {\n                    \"Field\": \"name\",\n                    \"Type\": \"varchar(255)\",\n                    \"Null\": \"NO\",\n                    \"Key\": null,\n                    \"Default\": null,\n                    \"Extra\": null\n                },\n                \"active\": {\n                    \"Field\": \"active\",\n                    \"Type\": \"int(2)\",\n                    \"Null\": \"NO\",\n                    \"Key\": null,\n                    \"Default\": \"1\",\n                    \"Extra\": null\n                },\n                \"seqid\": {\n                    \"Field\": \"seqid\",\n                    \"Type\": \"int(11)\",\n                    \"Null\": \"NO\",\n                    \"Key\": \"MUL\",\n                    \"Default\": \"0\",\n                    \"Extra\": null\n                },\n                \"seqmax\": {\n                    \"Field\": \"seqmax\",\n                    \"Type\": \"int(11)\",\n                    \"Null\": \"NO\",\n                    \"Key\": null,\n                    \"Default\": \"0\",\n                    \"Extra\": null\n                },\n                \"display_name\": {\n                    \"Field\": \"display_name\",\n                    \"Type\": \"text\",\n                    \"Null\": \"NO\",\n                    \"Key\": null,\n                    \"Default\": null,\n                    \"Extra\": null\n                },\n                \"is_system_enum\": {\n                    \"Field\": \"is_system_enum\",\n                    \"Type\": \"int(2)\",\n                    \"Null\": \"NO\",\n                    \"Key\": null,\n                    \"Default\": \"0\",\n                    \"Extra\": null\n                }\n            }\n        },\n        \"person_type\": {\n            \"Field\": \"person_type\",\n            \"Type\": \"text\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": null,\n            \"Extra\": null\n        },\n        \"employer_name\": {\n            \"Field\": \"employer_name\",\n            \"Type\": \"text\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": null,\n            \"Extra\": null\n        },\n        \"birth_date\": {\n            \"Field\": \"birth_date\",\n            \"Type\": \"date\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": \"0000-00-00\",\n            \"Extra\": null\n        },\n        \"employ_start_date\": {\n            \"Field\": \"employ_start_date\",\n            \"Type\": \"date\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": \"0000-00-00\",\n            \"Extra\": null\n        },\n        \"employ_end_date\": {\n            \"Field\": \"employ_end_date\",\n            \"Type\": \"date\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": \"0000-00-00\",\n            \"Extra\": null\n        },\n        \"hide_same_employer\": {\n            \"Field\": \"hide_same_employer\",\n            \"Type\": \"int(4)\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": \"0\",\n            \"Extra\": null\n        },\n        \"salary_currency\": {\n            \"Field\": \"salary_currency\",\n            \"Type\": \"varchar(256)\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": null,\n            \"Extra\": null\n        },\n        \"quota_currency\": {\n            \"Field\": \"quota_currency\",\n            \"Type\": \"varchar(256)\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": null,\n            \"Extra\": null\n        },\n        \"created_dt\": {\n            \"Field\": \"created_dt\",\n            \"Type\": \"datetime\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": \"0000-00-00 00:00:00\",\n            \"Extra\": null\n        },\n        \"updated_dt\": {\n            \"Field\": \"updated_dt\",\n            \"Type\": \"datetime\",\n            \"Null\": \"NO\",\n            \"Key\": null,\n            \"Default\": \"0000-00-00 00:00:00\",\n            \"Extra\": null\n        }\n    };\n    \n    Roo.log('Loading Data...');\n    _this.panel.loadData(data);\n\n}"
78          },
79          "xtype" : "Button",
80          "String text" : "Load Data",
81          "$ xns" : "Roo.Toolbar"
82         },
83         {
84          "xtype" : "Separator",
85          "$ xns" : "Roo.Toolbar"
86         },
87         {
88          "listeners" : {
89           "click" : "function (_self, e)\n{\n    \n    Roo.log('Converting to BJS...');\n    _this.panel.toBJS();\n\n}"
90          },
91          "xtype" : "Button",
92          "String text" : "To BJS",
93          "$ xns" : "Roo.Toolbar"
94         }
95        ]
96       },
97       {
98        "xtype" : "ColumnModel",
99        "width" : 75,
100        "header" : "Use ",
101        "$ 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 }",
102        "$ xns" : "Roo.grid",
103        "* prop" : "cm[]",
104        "dataIndex" : "active"
105       },
106       {
107        "xtype" : "ColumnModel",
108        "header" : "Database Column",
109        "width" : 150,
110        "$ renderer" : "function(v) { return String.format('{0}', v); }",
111        "$ xns" : "Roo.grid",
112        "* prop" : "cm[]",
113        "dataIndex" : "dataIndex"
114       },
115       {
116        "xtype" : "ColumnModel",
117        "width" : 100,
118        "header" : "Type",
119        "$ renderer" : "function(v) { return String.format('{0}', v); }",
120        "$ xns" : "Roo.grid",
121        "* prop" : "cm[]",
122        "dataIndex" : "type"
123       },
124       {
125        "xtype" : "ColumnModel",
126        "header" : "Label",
127        "width" : 120,
128        "$ renderer" : "function(v) { return String.format('{0}', v); }",
129        "$ xns" : "Roo.grid",
130        "* prop" : "cm[]",
131        "dataIndex" : "title",
132        "items" : [
133         {
134          "xtype" : "GridEditor",
135          "$ xns" : "Roo.grid",
136          "* prop" : "editor",
137          "items" : [
138           {
139            "xtype" : "TextField",
140            "$ xns" : "Roo.form",
141            "* prop" : "field"
142           }
143          ]
144         }
145        ]
146       },
147       {
148        "xtype" : "ColumnModel",
149        "width" : 120,
150        "header" : "Field Type",
151        "$ renderer" : "function(v) { return String.format('{0}', v); }",
152        "$ xns" : "Roo.grid",
153        "* prop" : "cm[]",
154        "dataIndex" : "ftype",
155        "items" : [
156         {
157          "xtype" : "GridEditor",
158          "$ xns" : "Roo.grid",
159          "* prop" : "editor",
160          "items" : [
161           {
162            "listWidth" : 200,
163            "triggerAction" : "all",
164            "displayField" : "fname",
165            "hiddenName" : "status",
166            "valueField" : "ftype",
167            "xtype" : "ComboBox",
168            "allowBlank" : false,
169            "editable" : false,
170            "width" : 150,
171            "$ xns" : "Roo.form",
172            "mode" : "local",
173            "name" : "ftype",
174            "* prop" : "field",
175            "items" : [
176             {
177              "xtype" : "SimpleStore",
178              "$ data" : "[ \n    [ 'ComboBox', \"ComboBox\"],\n    [ 'ComboBoxArray', \"ComboBoxArray\"] \n    [ 'TextField' , \"TextField\"],\n    [ 'NumberField', \"NumberField\"],\n    [ 'TextArea', \"TextArea\"],\n    [ 'HtmlEditor', \"HtmlEditor\"],\n    [ 'Hidden', \"Hidden\"],\n    [ 'DateField', \"DateField\"],\n    [ 'Checkbox', \"Checkbox\"]    \n    // checkbox?\n]\n",
179              "$ fields" : "[  'ftype', 'fname']",
180              "$ xns" : "Roo.data",
181              "* prop" : "store"
182             }
183            ]
184           }
185          ]
186         }
187        ]
188       },
189       {
190        "xtype" : "ColumnModel",
191        "header" : "Display Field",
192        "width" : 150,
193        "$ renderer" : "function(v) { return String.format('{0}', v); }",
194        "$ xns" : "Roo.grid",
195        "* prop" : "cm[]",
196        "dataIndex" : "display_field",
197        "items" : [
198         {
199          "xtype" : "GridEditor",
200          "$ xns" : "Roo.grid",
201          "* prop" : "editor",
202          "items" : [
203           {
204            "listWidth" : 200,
205            "triggerAction" : "all",
206            "displayField" : "dfield",
207            "hiddenName" : "status",
208            "valueField" : "dfield",
209            "xtype" : "ComboBox",
210            "allowBlank" : false,
211            "editable" : false,
212            "width" : 150,
213            "$ xns" : "Roo.form",
214            "mode" : "local",
215            "name" : "display_field",
216            "* prop" : "field",
217            "items" : [
218             {
219              "xtype" : "SimpleStore",
220              "$ data" : "[ \n    ['id']\n]\n",
221              "$ fields" : "[  'dfield']",
222              "$ xns" : "Roo.data",
223              "* prop" : "store"
224             }
225            ]
226           }
227          ]
228         }
229        ]
230       },
231       {
232        "xtype" : "ColumnModel",
233        "width" : 75,
234        "header" : "Width",
235        "$ renderer" : "function(v) { return String.format('{0}', v); }",
236        "$ xns" : "Roo.grid",
237        "* prop" : "cm[]",
238        "dataIndex" : "width",
239        "items" : [
240         {
241          "xtype" : "GridEditor",
242          "$ xns" : "Roo.grid",
243          "* prop" : "editor",
244          "items" : [
245           {
246            "xtype" : "NumberField",
247            "Number decimalPrecision" : 0,
248            "$ xns" : "Roo.form",
249            "* prop" : "field"
250           }
251          ]
252         }
253        ]
254       }
255      ]
256     }
257    ]
258   }
259  ]
260 }