resources/Editors/Editor.Roo.grid.Grid.bjs
[app.Builder.js] / resources / Editors / Editor.Roo.grid.Grid.bjs
1 {
2  "name" : "Editor.Roo.grid.Grid",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/resources/Editors/Editor.Roo.grid.Grid.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "4ce58cbe362a5d7b156992a496d55bf3" : "Database Column",
10   "b78a3223503896721cca1303f776159b" : "Title",
11   "2f616612593df62aeed112de4f03110e" : "Edit a Grid",
12   "0ccc2bf3fb98387c23b6ca5500244d6e" : "Use ",
13   "c671c787b49f50a3ace9fdc5bd597825" : "core_enum",
14   "32954654ac8fe66a1d09be19001de2d4" : "Width",
15   "a1fa27779242b4902f7ae3bdd5c6d508" : "Type",
16   "6e7376dca68a2386a8737944196ab491" : "Create / Edit Grid"
17  },
18  "items" : [
19   {
20    "listeners" : {
21     "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
22    },
23    "| 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        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    alert(\"IPC:TEST:\" + JSON.stringify(ar));\n    this.grid.dataSource.loadData(ar);\n}",
24    "| function toBJS" : "function() { }",
25    "fitToframe" : true,
26    "background" : false,
27    "region" : "center",
28    "title" : "core_enum",
29    "xtype" : "GridPanel",
30    "$ xns" : "Roo",
31    "fitContainer" : true,
32    "String title" : "Create / Edit Grid",
33    "tableName" : "core_enum",
34    "items" : [
35     {
36      "listeners" : {
37       "|rowdblclick" : "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n  \n}\n",
38       "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}",
39       "|render" : "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n\n}"
40      },
41      "Number clicksToEdit" : 1,
42      "autoExpandColumn" : "title",
43      "xtype" : "EditorGrid",
44      "loadMask" : true,
45      "$ xns" : "Roo.grid",
46      "* prop" : "grid",
47      "items" : [
48       {
49        "$ Array fields" : "[ 'active', 'dataIndex', 'type','title', 'width' ]",
50        "$ Array data" : "[\n  [ 1, 'test', 'test', 110 ]\n  \n\n]",
51        "Number id" : "'dataIndex'",
52        "xtype" : "SimpleStore",
53        "$ xns" : "Roo.data",
54        "* prop" : "ds"
55       },
56       {
57        "xtype" : "Toolbar",
58        "$ xns" : "Roo",
59        "* prop" : "toolbar",
60        "items" : [
61         {
62          "string text" : "Edit a Grid",
63          "xtype" : "TextItem",
64          "$ xns" : "Roo.Toolbar"
65         }
66        ]
67       },
68       {
69        "xtype" : "ColumnModel",
70        "header" : "Use ",
71        "width" : 75,
72        "$ 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 }",
73        "$ xns" : "Roo.grid",
74        "* prop" : "cm[]",
75        "dataIndex" : "active"
76       },
77       {
78        "xtype" : "ColumnModel",
79        "width" : 150,
80        "header" : "Database Column",
81        "$ renderer" : "function(v) { return String.format('{0}', v); }",
82        "$ xns" : "Roo.grid",
83        "* prop" : "cm[]",
84        "dataIndex" : "dataIndex"
85       },
86       {
87        "xtype" : "ColumnModel",
88        "header" : "Type",
89        "width" : 100,
90        "$ renderer" : "function(v) { return String.format('{0}', v); }",
91        "$ xns" : "Roo.grid",
92        "* prop" : "cm[]",
93        "dataIndex" : "type"
94       },
95       {
96        "xtype" : "ColumnModel",
97        "width" : 75,
98        "header" : "Title",
99        "$ renderer" : "function(v) { return String.format('{0}', v); }",
100        "$ xns" : "Roo.grid",
101        "* prop" : "cm[]",
102        "dataIndex" : "title",
103        "items" : [
104         {
105          "xtype" : "GridEditor",
106          "$ xns" : "Roo.grid",
107          "* prop" : "editor",
108          "items" : [
109           {
110            "xtype" : "TextField",
111            "$ xns" : "Roo.form",
112            "* prop" : "field"
113           }
114          ]
115         }
116        ]
117       },
118       {
119        "xtype" : "ColumnModel",
120        "header" : "Width",
121        "width" : 75,
122        "$ renderer" : "function(v) { return String.format('{0}', v); }",
123        "$ xns" : "Roo.grid",
124        "* prop" : "cm[]",
125        "dataIndex" : "width",
126        "items" : [
127         {
128          "xtype" : "GridEditor",
129          "$ xns" : "Roo.grid",
130          "* prop" : "editor",
131          "items" : [
132           {
133            "xtype" : "NumberField",
134            "Number decimalPrecision" : 0,
135            "$ xns" : "Roo.form",
136            "* prop" : "field"
137           }
138          ]
139         }
140        ]
141       }
142      ]
143     }
144    ]
145   }
146  ]
147 }