Pman.Tab.BAdminCoreEnum.bjs
[Pman.BAdmin] / Pman.Tab.BAdminCoreEnum.bjs
1 {
2  "name" : "Pman.Tab.BAdminCoreEnum",
3  "parent" : "Pman.Tab.BAdmin",
4  "title" : "",
5  "path" : "/home/johns/gitlive/Pman.BAdmin/Pman.Tab.BAdminCoreEnum.bjs",
6  "permname" : "",
7  "modOrder" : "005",
8  "strings" : {
9   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
10   "2df80d5febcde0c10a66818488622b7c" : "Pulldown Options",
11   "7dce122004969d56ae2e0245cb754d35" : "Edit",
12   "01abfc750a0c942167651c40d088531d" : "#",
13   "dae8ace18bdcbcc6ae5aece263e14fe8" : "Options",
14   "b48968e1c912da07df5e8d6d246291ec" : "Display Name",
15   "f2d346b1bb7c1c85ab6f7f21e3666b9f" : "Types",
16   "49ee3087348e8d44e1feda1917443987" : "Name",
17   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
18   "4d3d769b812b6faa6b76e1a8abaece2d" : "Active"
19  },
20  "items" : [
21   {
22    "xtype" : "Nest",
23    "$ xns" : "Roo.bootstrap.panel",
24    "String title" : "Pulldown Options",
25    "Boolean background" : true,
26    "items" : [
27     {
28      "xtype" : "Border",
29      "$ xns" : "Roo.bootstrap.layout",
30      "* prop" : "layout",
31      "items" : [
32       {
33        "String tabPosition" : "top",
34        "Boolean hideTabs" : true,
35        "xtype" : "Region",
36        "$ xns" : "Roo.bootstrap.layout",
37        "* prop" : "center"
38       },
39       {
40        "String tabPosition" : "top",
41        "Number width" : 350,
42        "xtype" : "Region",
43        "Boolean hideTabs" : true,
44        "$ xns" : "Roo.bootstrap.layout",
45        "* prop" : "west",
46        "Boolean split" : true
47       },
48       {
49        "listeners" : {
50         "activate" : "function (_self)\n{\n    if(_this.type_grid) {\n        _this.type_grid.footer.onClick('first');\n    }\n}",
51         "render" : "function (_self)\n{\n    _this.type_panel = _self; \n}"
52        },
53        "Boolean fitContainer" : true,
54        "xtype" : "Grid",
55        "Boolean fitToFrame" : true,
56        "String region" : "west",
57        "$ xns" : "Roo.bootstrap.panel",
58        "String title" : "Types",
59        "Boolean background" : false,
60        "Boolean closable" : false,
61        "items" : [
62         {
63          "xtype" : "NavSimplebar",
64          "$ xns" : "Roo.bootstrap",
65          "* prop" : "toolbar",
66          "items" : [
67           {
68            "xtype" : "NavGroup",
69            "$ xns" : "Roo.bootstrap",
70            "items" : [
71             {
72              "xtype" : "NavItem",
73              "$ xns" : "Roo.bootstrap",
74              "items" : [
75               {
76                "listeners" : {
77                 "click" : "function (_self, e)\n{\n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : 0\n    }, function(res) {\n        _this.type_grid.footer.onClick('first');\n    });\n\n}"
78                },
79                "String weight" : "default",
80                "xtype" : "Button",
81                "$ xns" : "Roo.bootstrap",
82                "String html" : "Add",
83                "String style" : "margin: 10px;",
84                "String glyphicon" : "plus"
85               }
86              ]
87             }
88            ]
89           }
90          ]
91         },
92         {
93          "listeners" : {
94           "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n    var r = _this.type_grid.store.getAt(rowIndex);\n    \n    if(!r || r.data.id * 1 < 1){\n        return;\n    }\n    \n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : r.data.id\n    }, function(res) {\n        _this.type_grid.footer.onClick('first');\n    });\n}",
95           "render" : "function (_self)\n{\n    _this.type_grid = _self; \n   \n}"
96          },
97          "String cls" : "table-fixed",
98          "Boolean cellSelection" : true,
99          "boolean hover" : true,
100          "boolean striped" : false,
101          "xtype" : "Table",
102          "boolean responsive" : true,
103          "Boolean rowSelection" : true,
104          "$ xns" : "Roo.bootstrap",
105          "Boolean loadMask" : true,
106          "* prop" : "grid",
107          "items" : [
108           {
109            "listeners" : {
110             "selectionchange" : "function (_self)\n{\n    _this.option_grid.store.load({});\n}"
111            },
112            "Boolean singleSelect" : true,
113            "xtype" : "RowSelectionModel",
114            "$ xns" : "Roo.bootstrap.Table",
115            "* prop" : "sm"
116           },
117           {
118            "listeners" : {
119             "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    o.params['query[empty_etype]'] = 1;\n    \n}"
120            },
121            "$ Object sortInfo" : "{ field : 'display_name', direction: 'ASC' }",
122            "xtype" : "Store",
123            "boolean remoteSort" : true,
124            "$ xns" : "Roo.data",
125            "* prop" : "store",
126            "items" : [
127             {
128              "$ Array fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'etype',\n        'type': 'string'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'display_name',\n        'type': 'string'\n    },\n    {\n        'name': 'active',\n        'type': 'int'\n    },\n    {\n        'name': 'seqid',\n        'type': 'int'\n    }\n]",
129              "xtype" : "JsonReader",
130              "String root" : "data",
131              "$ xns" : "Roo.data",
132              "String id" : "id",
133              "* prop" : "reader",
134              "String totalProperty" : "total"
135             },
136             {
137              "$ url" : "baseURL + '/Roo/core_enum.php'",
138              "xtype" : "HttpProxy",
139              "$ xns" : "Roo.data",
140              "String method" : "GET",
141              "* prop" : "proxy"
142             }
143            ]
144           },
145           {
146            "String header" : "Name",
147            "String dataIndex" : "display_name",
148            "xtype" : "ColumnModel",
149            "Number xs" : 12,
150            "$ xns" : "Roo.grid",
151            "$ renderer" : "function(v,x,r) { \n    return String.format('<span tooltip=\"{1}\">Coba: {0}</span>', v, r.data.name); \n}",
152            "Boolean sortable" : true,
153            "* prop" : "cm[]"
154           },
155           {
156            "Number pageSize" : 100,
157            "Boolean displayInfo" : false,
158            "xtype" : "PagingToolbar",
159            "$ xns" : "Roo.bootstrap",
160            "* prop" : "footer",
161            "string name" : "footer"
162           }
163          ]
164         }
165        ]
166       },
167       {
168        "listeners" : {
169         "activate" : "function (_self)\n{\n    if (_this.option_grid) {\n        _this.option_grid.store.load({});\n//        _this.option_grid.footer.onClick('first');\n    }\n}",
170         "render" : "function (_self)\n{\n    _this.option_panel = _self;\n}"
171        },
172        "Boolean fitContainer" : true,
173        "xtype" : "Grid",
174        "Boolean fitToFrame" : true,
175        "String region" : "center",
176        "$ xns" : "Roo.bootstrap.panel",
177        "String title" : "Options",
178        "Boolean background" : false,
179        "items" : [
180         {
181          "xtype" : "NavSimplebar",
182          "$ xns" : "Roo.bootstrap",
183          "* prop" : "toolbar",
184          "items" : [
185           {
186            "xtype" : "NavGroup",
187            "$ xns" : "Roo.bootstrap",
188            "items" : [
189             {
190              "xtype" : "NavItem",
191              "$ xns" : "Roo.bootstrap",
192              "items" : [
193               {
194                "listeners" : {
195                 "click" : "function (_self, e)\n{\n    var sel = _this.type_grid.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length ){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');\n        return;\n    }\n\n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : 0,\n        etype : sel.data.name\n    }, function(res) {\n        _this.option_grid.store.load({});\n    });\n\n}"
196                },
197                "String weight" : "default",
198                "xtype" : "Button",
199                "$ xns" : "Roo.bootstrap",
200                "String html" : "Add",
201                "String style" : "margin: 10px;",
202                "String glyphicon" : "plus"
203               },
204               {
205                "listeners" : {
206                 "click" : "function (_self, e)\n{\n    var sel = _this.option_grid.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');\n        return;\n    }\n\n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : sel.data.id\n    }, function(res) {\n        _this.option_grid.store.load({});\n    });\n\n}"
207                },
208                "String weight" : "default",
209                "xtype" : "Button",
210                "$ xns" : "Roo.bootstrap",
211                "String html" : "Edit",
212                "String style" : "margin: 10px;",
213                "String glyphicon" : "pencil"
214               },
215               {
216                "listeners" : {
217                 "click" : "function (_self, e)\n{\n    var sel = _this.option_grid.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');\n        return;\n    }\n\n    new Pman.Request({\n        url: baseURL + '/Roo/Core_enum.php',\n        method : 'POST',\n        params : {\n            _delete : sel.data.id\n        }, \n        success : function(res) {\n            _this.option_grid.store.load({});\n        }\n    });\n\n}"
218                },
219                "String weight" : "primary",
220                "xtype" : "Button",
221                "$ xns" : "Roo.bootstrap",
222                "String html" : "Delete",
223                "String style" : "margin: 10px;",
224                "String glyphicon" : "trash"
225               }
226              ]
227             }
228            ]
229           }
230          ]
231         },
232         {
233          "listeners" : {
234           "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n    var sel = _this.option_grid.store.getAt(rowIndex);\n    \n    if(!sel || sel.data.id * 1 < 1){\n        return;\n    }\n    \n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : sel.data.id\n    }, function(res) {\n        _this.option_grid.store.load({});\n    });\n    \n}",
235           "cellclick" : "function (_self, el, rowIndex, columnIndex, e)\n{\n    var di = _this.option_grid.colModel.getDataIndex(columnIndex);\n    \n    if (di != 'active') {\n        return;\n    }\n     \n    var rec = _this.option_grid.store.getAt(rowIndex);\n    \n    rec.set('active', rec.data.active ? 0 : 1);\n    \n    rec.commit();\n}",
236           "render" : "function (_self)\n{\n    _this.option_grid = _self; \n\n}"
237          },
238          "Boolean footerShow" : false,
239          "Boolean cellSelection" : true,
240          "String cls" : "table-fixed",
241          "boolean hover" : true,
242          "boolean striped" : true,
243          "xtype" : "Table",
244          "boolean responsive" : true,
245          "Boolean rowSelection" : true,
246          "$ xns" : "Roo.bootstrap",
247          "Boolean loadMask" : true,
248          "* prop" : "grid",
249          "items" : [
250           {
251            "Boolean singleSelect" : true,
252            "xtype" : "RowSelectionModel",
253            "$ xns" : "Roo.bootstrap.Table",
254            "* prop" : "sm"
255           },
256           {
257            "listeners" : {
258             "update" : "function (_self, record, operation)\n{\n    if (operation != 'commit') {\n        return;\n    }\n\n    new Pman.Request({\n        url : baseURL + '/Roo/Core_enum',\n        method :'POST',\n        params : {\n            id : record.data.id,\n            active: record.data.active\n        },\n        success : function() {\n\n        },\n        failure : function() \n        {\n            Roo.bootstrap.MessageBox.alert(\"Error\", \"saving failed\", function() {\n                _this.grid.footer.onClick('first');\n            });\n        }\n    });\n}",
259             "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    var sel = _this.type_grid.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length){\n        this.removeAll();\n        return false;\n    }\n    \n    o.params.etype = sel.data.name;\n    \n}"
260            },
261            "xtype" : "Store",
262            "boolean remoteSort" : true,
263            "$ xns" : "Roo.data",
264            "$ sortinfo" : "{ field : 'display_name', direction: 'ASC' }",
265            "* prop" : "store",
266            "items" : [
267             {
268              "$ Array fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'etype',\n        'type': 'string'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'display_name',\n        'type': 'string'\n    },\n    {\n        'name': 'active',\n        'type': 'int'\n    },\n    {\n        'name': 'seqid',\n        'type': 'int'\n    }\n]",
269              "xtype" : "JsonReader",
270              "String root" : "data",
271              "$ xns" : "Roo.data",
272              "String id" : "id",
273              "* prop" : "reader",
274              "String totalProperty" : "total"
275             },
276             {
277              "$ url" : "baseURL + '/Roo/core_enum.php'",
278              "xtype" : "HttpProxy",
279              "$ xns" : "Roo.data",
280              "String method" : "GET",
281              "* prop" : "proxy"
282             }
283            ]
284           },
285           {
286            "String header" : "#",
287            "String dataIndex" : "id",
288            "Number md" : 2,
289            "xtype" : "ColumnModel",
290            "Number xs" : 2,
291            "$ xns" : "Roo.grid",
292            "$ renderer" : "function(v,x,r) {\n    //console.log(r.data.seqid);\n    //return String.format('{0}', v ? v : '');\n    \n    return \n        String.format('{0}', r.data.seqid ? r.data.seqid : '')\n        +\" <span style='color:lightgrey'>\"\n        + String.format('{0}', r.data.id ? r.data.id : '')\n        +\"</span>\";\n}",
293            "Boolean sortable" : false,
294            "* prop" : "cm[]",
295            "Number sm" : 2
296           },
297           {
298            "String header" : "Name",
299            "Number md" : 4,
300            "String dataIndex" : "name",
301            "xtype" : "ColumnModel",
302            "Number xs" : 4,
303            "$ xns" : "Roo.grid",
304            "$ renderer" : "function(v,x,r) { \n    return String.format('{0}', v ? v : '');\n}",
305            "Boolean sortable" : false,
306            "* prop" : "cm[]",
307            "Number sm" : 4
308           },
309           {
310            "String header" : "Display Name",
311            "String dataIndex" : "display_name",
312            "Number md" : 4,
313            "xtype" : "ColumnModel",
314            "Number xs" : 4,
315            "$ xns" : "Roo.grid",
316            "$ renderer" : "function(v,x,r) { \n    return String.format('{0}', v ? v : '');\n}",
317            "Boolean sortable" : false,
318            "* prop" : "cm[]",
319            "Number sm" : 4
320           },
321           {
322            "String header" : "Active",
323            "Number md" : 2,
324            "String dataIndex" : "active",
325            "xtype" : "ColumnModel",
326            "Number xs" : 2,
327            "$ xns" : "Roo.grid",
328            "$ renderer" : "function(v,x,r) { \n    var state = v > 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n}",
329            "Boolean sortable" : false,
330            "* prop" : "cm[]",
331            "Number sm" : 2
332           }
333          ]
334         }
335        ]
336       }
337      ]
338     }
339    ]
340   }
341  ]
342 }