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