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        ar.push([ false, r.Field, r.Type,  r.Field, 100] );\n    }\n    \n    alert(\"IPC:TEST:\" + JSON.stringify(ar));\n    this.grid.dataSource.loadData(ar);\n}",
24    "background" : false,
25    "fitToframe" : true,
26    "region" : "center",
27    "title" : "core_enum",
28    "xtype" : "GridPanel",
29    "$ xns" : "Roo",
30    "fitContainer" : true,
31    "String title" : "Create / Edit Grid",
32    "tableName" : "core_enum",
33    "items" : [
34     {
35      "listeners" : {
36       "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}",
37       "|render" : "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n\n}"
38      },
39      "Number clicksToEdit" : 1,
40      "autoExpandColumn" : "title",
41      "xtype" : "EditorGrid",
42      "loadMask" : true,
43      "$ xns" : "Roo.grid",
44      "* prop" : "grid",
45      "items" : [
46       {
47        "$ Array fields" : "[ 'active', 'dataIndex', 'type','title', 'width' ]",
48        "$ Array data" : "[\n  [ 1, 'test', 'test', 110 ]\n  \n\n]",
49        "Number id" : "'dataIndex'",
50        "xtype" : "SimpleStore",
51        "$ xns" : "Roo.data",
52        "* prop" : "ds"
53       },
54       {
55        "xtype" : "Toolbar",
56        "$ xns" : "Roo",
57        "* prop" : "toolbar",
58        "items" : [
59         {
60          "string text" : "Edit a Grid",
61          "xtype" : "TextItem",
62          "$ xns" : "Roo.Toolbar"
63         }
64        ]
65       },
66       {
67        "xtype" : "ColumnModel",
68        "width" : 75,
69        "header" : "Use ",
70        "$ 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 }",
71        "$ xns" : "Roo.grid",
72        "* prop" : "cm[]",
73        "dataIndex" : "active"
74       },
75       {
76        "xtype" : "ColumnModel",
77        "header" : "Database Column",
78        "width" : 150,
79        "$ renderer" : "function(v) { return String.format('{0}', v); }",
80        "$ xns" : "Roo.grid",
81        "* prop" : "cm[]",
82        "dataIndex" : "dataIndex"
83       },
84       {
85        "xtype" : "ColumnModel",
86        "width" : 100,
87        "header" : "Type",
88        "$ renderer" : "function(v) { return String.format('{0}', v); }",
89        "$ xns" : "Roo.grid",
90        "* prop" : "cm[]",
91        "dataIndex" : "type"
92       },
93       {
94        "xtype" : "ColumnModel",
95        "header" : "Title",
96        "width" : 75,
97        "$ renderer" : "function(v) { return String.format('{0}', v); }",
98        "$ xns" : "Roo.grid",
99        "* prop" : "cm[]",
100        "dataIndex" : "title",
101        "items" : [
102         {
103          "xtype" : "GridEditor",
104          "$ xns" : "Roo.grid",
105          "* prop" : "editor",
106          "items" : [
107           {
108            "xtype" : "TextField",
109            "$ xns" : "Roo.form",
110            "* prop" : "field"
111           }
112          ]
113         }
114        ]
115       },
116       {
117        "xtype" : "ColumnModel",
118        "width" : 75,
119        "header" : "Width",
120        "$ renderer" : "function(v) { return String.format('{0}', v); }",
121        "$ xns" : "Roo.grid",
122        "* prop" : "cm[]",
123        "dataIndex" : "width",
124        "items" : [
125         {
126          "xtype" : "GridEditor",
127          "$ xns" : "Roo.grid",
128          "* prop" : "editor",
129          "items" : [
130           {
131            "xtype" : "NumberField",
132            "Number decimalPrecision" : 0,
133            "$ xns" : "Roo.form",
134            "* prop" : "field"
135           }
136          ]
137         }
138        ]
139       }
140      ]
141     }
142    ]
143   }
144  ]
145 }