Pman.Dialog.BAdminForgotPassword.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   "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    _this.type_edit_btn.hide();\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                "xtype" : "Element",
77                "$ xns" : "Roo.bootstrap",
78                "items" : [
79                 {
80                  "String cls" : "roo-toolbar",
81                  "xtype" : "Row",
82                  "$ xns" : "Roo.bootstrap",
83                  "items" : [
84                   {
85                    "Number md" : 12,
86                    "xtype" : "Column",
87                    "$ xns" : "Roo.bootstrap",
88                    "items" : [
89                     {
90                      "listeners" : {
91                       "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}"
92                      },
93                      "String cls" : "roo-toolbar-button",
94                      "String weight" : "default",
95                      "xtype" : "Button",
96                      "$ xns" : "Roo.bootstrap",
97                      "String html" : "Add",
98                      "String glyphicon" : "plus"
99                     },
100                     {
101                      "listeners" : {
102                       "render" : "function (_self)\n{\n    _this.type_edit_btn = this;\n    \n    this.hide();\n}",
103                       "click" : "function (_self, e)\n{\n    var sel = _this.type_grid.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');\n        return;\n    }\n\n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : sel.data.id\n    }, function(res) {\n        _this.type_grid.footer.onClick('first');\n    });\n}"
104                      },
105                      "String cls" : "roo-toolbar-button",
106                      "String weight" : "default",
107                      "xtype" : "Button",
108                      "$ xns" : "Roo.bootstrap",
109                      "String html" : "Edit",
110                      "String glyphicon" : "edit"
111                     }
112                    ]
113                   }
114                  ]
115                 }
116                ]
117               }
118              ]
119             }
120            ]
121           }
122          ]
123         },
124         {
125          "listeners" : {
126           "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}",
127           "render" : "function (_self)\n{\n    _this.type_grid = _self; \n   \n}"
128          },
129          "String cls" : "table-fixed",
130          "Boolean cellSelection" : true,
131          "boolean hover" : true,
132          "boolean striped" : false,
133          "xtype" : "Table",
134          "boolean responsive" : true,
135          "Boolean rowSelection" : true,
136          "$ xns" : "Roo.bootstrap",
137          "Boolean loadMask" : true,
138          "* prop" : "grid",
139          "items" : [
140           {
141            "listeners" : {
142             "selectionchange" : "function (_self)\n{\n    _this.type_edit_btn.hide();\n    \n    if(this.getSelected()){\n        _this.type_edit_btn.show();\n    }\n    \n    _this.option_grid.store.load({});\n}"
143            },
144            "Boolean singleSelect" : true,
145            "xtype" : "RowSelectionModel",
146            "$ xns" : "Roo.bootstrap.Table",
147            "* prop" : "sm"
148           },
149           {
150            "listeners" : {
151             "beforeload" : "function (_self, o)\n{\n      if (!Pman.buildCompleted) {\n        return false;\n    }\n    \n    o.params = o.params || {};\n    \n    o.params['query[empty_etype]'] = 1;\n    \n}",
152             "load" : "function (_self, records, options)\n{\n    _this.type_edit_btn.hide();\n}"
153            },
154            "$ Object sortInfo" : "{ field : 'display_name', direction: 'ASC' }",
155            "xtype" : "Store",
156            "boolean remoteSort" : true,
157            "$ xns" : "Roo.data",
158            "* prop" : "store",
159            "items" : [
160             {
161              "$ 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]",
162              "xtype" : "JsonReader",
163              "String root" : "data",
164              "$ xns" : "Roo.data",
165              "String id" : "id",
166              "* prop" : "reader",
167              "String totalProperty" : "total"
168             },
169             {
170              "$ url" : "baseURL + '/Roo/core_enum.php'",
171              "xtype" : "HttpProxy",
172              "$ xns" : "Roo.data",
173              "String method" : "GET",
174              "* prop" : "proxy"
175             }
176            ]
177           },
178           {
179            "String header" : "Name",
180            "String cursor" : "pointer",
181            "String dataIndex" : "display_name",
182            "xtype" : "ColumnModel",
183            "Number xs" : 12,
184            "$ xns" : "Roo.grid",
185            "$ renderer" : "function(v,x,r) {\n    if (v.match(/Coba/g) || v.match(/Risk Question/g)) {\n        return String.format('<span tooltip=\"{1}\">Coba: {0}</span>', v, r.data.name);\n    }\n    \n    return String.format('<span tooltip=\"{1}\">{0}</span>', v, r.data.name); \n}",
186            "Boolean sortable" : true,
187            "* prop" : "cm[]"
188           },
189           {
190            "Number pageSize" : 100,
191            "Boolean displayInfo" : false,
192            "xtype" : "PagingToolbar",
193            "$ xns" : "Roo.bootstrap",
194            "* prop" : "footer",
195            "string name" : "footer"
196           }
197          ]
198         }
199        ]
200       },
201       {
202        "listeners" : {
203         "activate" : "function (_self)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n    \n    if (_this.option_grid) {\n        _this.option_grid.store.load({});\n    }\n}",
204         "render" : "function (_self)\n{\n    _this.option_panel = _self;\n}"
205        },
206        "Boolean fitContainer" : true,
207        "xtype" : "Grid",
208        "Boolean fitToFrame" : true,
209        "String region" : "center",
210        "$ xns" : "Roo.bootstrap.panel",
211        "String title" : "Options",
212        "Boolean background" : false,
213        "items" : [
214         {
215          "xtype" : "NavSimplebar",
216          "$ xns" : "Roo.bootstrap",
217          "* prop" : "toolbar",
218          "items" : [
219           {
220            "xtype" : "NavGroup",
221            "$ xns" : "Roo.bootstrap",
222            "items" : [
223             {
224              "xtype" : "NavItem",
225              "$ xns" : "Roo.bootstrap",
226              "items" : [
227               {
228                "xtype" : "Element",
229                "$ xns" : "Roo.bootstrap",
230                "items" : [
231                 {
232                  "String cls" : "roo-toolbar",
233                  "xtype" : "Row",
234                  "$ xns" : "Roo.bootstrap",
235                  "items" : [
236                   {
237                    "Number md" : 12,
238                    "xtype" : "Column",
239                    "$ xns" : "Roo.bootstrap",
240                    "items" : [
241                     {
242                      "listeners" : {
243                       "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}"
244                      },
245                      "String cls" : "roo-toolbar-button",
246                      "String weight" : "default",
247                      "xtype" : "Button",
248                      "$ xns" : "Roo.bootstrap",
249                      "String html" : "Add",
250                      "String glyphicon" : "plus"
251                     },
252                     {
253                      "listeners" : {
254                       "render" : "function (_self)\n{\n    _this.edit_btn = this;\n    \n    this.hide();\n}",
255                       "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}"
256                      },
257                      "String cls" : "roo-toolbar-button",
258                      "String weight" : "default",
259                      "xtype" : "Button",
260                      "$ xns" : "Roo.bootstrap",
261                      "String html" : "Edit",
262                      "String glyphicon" : "edit"
263                     },
264                     {
265                      "listeners" : {
266                       "render" : "function (_self)\n{\n    _this.delete_btn = this;\n    \n    this.hide();\n}",
267                       "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}"
268                      },
269                      "String cls" : "roo-toolbar-button",
270                      "String weight" : "primary",
271                      "xtype" : "Button",
272                      "$ xns" : "Roo.bootstrap",
273                      "String html" : "Delete",
274                      "String glyphicon" : "trash"
275                     }
276                    ]
277                   }
278                  ]
279                 }
280                ]
281               }
282              ]
283             }
284            ]
285           }
286          ]
287         },
288         {
289          "listeners" : {
290           "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}",
291           "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    \n    /*if(rec.data.active * 1 != 1){\n        var el = _this.option_grid.getRowDom(rowIndex);\n        \n        el.addClass('x-grid-row-fadeout');\n        \n        el.on('transitionend',function(){\n            _this.option_grid.ds.remove(rec);\n            el.remove();\n        },this,{single:true});\n    }*/\n}",
292           "render" : "function (_self)\n{\n    _this.option_grid = _self; \n\n}"
293          },
294          "String cls" : "table-fixed",
295          "Boolean footerShow" : false,
296          "Boolean cellSelection" : true,
297          "boolean hover" : true,
298          "boolean striped" : true,
299          "xtype" : "Table",
300          "boolean responsive" : true,
301          "Boolean rowSelection" : true,
302          "$ xns" : "Roo.bootstrap",
303          "Boolean loadMask" : true,
304          "* prop" : "grid",
305          "items" : [
306           {
307            "listeners" : {
308             "selectionchange" : "function (_self)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n    \n    if (!this.getSelected()) {\n        return;\n    }\n    \n    _this.edit_btn.show();\n    _this.delete_btn.show();\n    \n}"
309            },
310            "Boolean singleSelect" : true,
311            "xtype" : "RowSelectionModel",
312            "$ xns" : "Roo.bootstrap.Table",
313            "* prop" : "sm"
314           },
315           {
316            "listeners" : {
317             "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}",
318             "beforeload" : "function (_self, o)\n{\n    if (!Pman.buildCompleted) {\n        return false;\n    }\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}",
319             "load" : "function (_self, records, options)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n}"
320            },
321            "xtype" : "Store",
322            "boolean remoteSort" : true,
323            "$ xns" : "Roo.data",
324            "$ sortInfo" : "{ field : 'display_name', direction: 'ASC' }",
325            "* prop" : "store",
326            "items" : [
327             {
328              "$ 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]",
329              "xtype" : "JsonReader",
330              "String root" : "data",
331              "$ xns" : "Roo.data",
332              "String id" : "id",
333              "* prop" : "reader",
334              "String totalProperty" : "total"
335             },
336             {
337              "$ url" : "baseURL + '/Roo/core_enum.php'",
338              "xtype" : "HttpProxy",
339              "$ xns" : "Roo.data",
340              "String method" : "GET",
341              "* prop" : "proxy"
342             }
343            ]
344           },
345           {
346            "String header" : "#",
347            "String cursor" : "pointer",
348            "String dataIndex" : "id",
349            "Number md" : 2,
350            "xtype" : "ColumnModel",
351            "Number xs" : 2,
352            "$ xns" : "Roo.grid",
353            "$ 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}",
354            "Boolean sortable" : false,
355            "* prop" : "cm[]",
356            "Number sm" : 2
357           },
358           {
359            "String header" : "Name",
360            "String cursor" : "pointer",
361            "Number md" : 4,
362            "String dataIndex" : "name",
363            "xtype" : "ColumnModel",
364            "Number xs" : 4,
365            "$ xns" : "Roo.grid",
366            "$ renderer" : "function(v,x,r) { \n    return String.format('{0}', v ? v : '');\n}",
367            "Boolean sortable" : false,
368            "* prop" : "cm[]",
369            "Number sm" : 4
370           },
371           {
372            "String header" : "Display Name",
373            "String cursor" : "pointer",
374            "String dataIndex" : "display_name",
375            "Number md" : 4,
376            "xtype" : "ColumnModel",
377            "Number xs" : 4,
378            "$ xns" : "Roo.grid",
379            "$ renderer" : "function(v,x,r) { \n    return String.format('{0}', v ? v : '');\n}",
380            "Boolean sortable" : false,
381            "* prop" : "cm[]",
382            "Number sm" : 4
383           },
384           {
385            "String header" : "Active",
386            "String cursor" : "pointer",
387            "Number md" : 2,
388            "String dataIndex" : "active",
389            "xtype" : "ColumnModel",
390            "Number xs" : 2,
391            "$ xns" : "Roo.grid",
392            "$ renderer" : "function(v,x,r) { \n    \n    var state = v > 0 ? 'check-' : '';\n    \n    //return '<img class=\\\"x-grid-check-icon' + state + '\\\" src=\\\"' + Roo.BLANK_IMAGE_URL + '\\\"/>';\n    return '<i class=\"far fa-'+ state + 'square-o fa-2x\" aria-hidden=\"true\"></i>';\n}",
393            "Boolean sortable" : false,
394            "* prop" : "cm[]",
395            "Number sm" : 2
396           }
397          ]
398         }
399        ]
400       }
401      ]
402     }
403    ]
404   }
405  ]
406 }