"name" : "Pman.Tab.BAdminCoreEnum",
"parent" : "Pman.Tab.BAdmin",
"title" : "",
- "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Tab.BAdminCoreEnum.bjs",
+ "path" : "/home/alan/gitlive/Pman.BAdmin/Pman.Tab.BAdminCoreEnum.bjs",
"permname" : "",
"modOrder" : "005",
"strings" : {
"ec211f7c20af43e742bf2570c3cb84f9" : "Add",
"2df80d5febcde0c10a66818488622b7c" : "Pulldown Options",
- "aba9f7d7443652e858969bfc280690b1" : "Manage Groups ",
"7dce122004969d56ae2e0245cb754d35" : "Edit",
"01abfc750a0c942167651c40d088531d" : "#",
"dae8ace18bdcbcc6ae5aece263e14fe8" : "Options",
"b48968e1c912da07df5e8d6d246291ec" : "Display Name",
"f2d346b1bb7c1c85ab6f7f21e3666b9f" : "Types",
- "4d1c8263ba1036754f8db14a98f9f006" : "Reload",
"49ee3087348e8d44e1feda1917443987" : "Name",
"f2a6c498fb90ee345d997f888fce3b18" : "Delete",
"4d3d769b812b6faa6b76e1a8abaece2d" : "Active"
"items" : [
{
"String tabPosition" : "top",
- "Boolean hideTabs" : true,
"xtype" : "Region",
+ "Boolean hideTabs" : true,
"$ xns" : "Roo.bootstrap.layout",
"* prop" : "center"
},
},
{
"listeners" : {
- "activate" : "function (_self)\n{\n if(_this.type_grid) {\n _this.type_grid.footer.onClick('first');\n }\n}",
+ "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}",
"render" : "function (_self)\n{\n _this.type_panel = _self; \n}"
},
"Boolean fitContainer" : true,
"$ xns" : "Roo.bootstrap",
"items" : [
{
- "listeners" : {
- "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}"
- },
- "String weight" : "primary",
- "xtype" : "Button",
+ "xtype" : "Element",
"$ xns" : "Roo.bootstrap",
- "String html" : "Add",
- "String style" : "margin: 10px;",
- "String glyphicon" : "plus"
+ "items" : [
+ {
+ "String cls" : "roo-toolbar",
+ "xtype" : "Row",
+ "$ xns" : "Roo.bootstrap",
+ "items" : [
+ {
+ "Number md" : 12,
+ "xtype" : "Column",
+ "$ xns" : "Roo.bootstrap",
+ "items" : [
+ {
+ "listeners" : {
+ "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}"
+ },
+ "String cls" : "roo-toolbar-button",
+ "String weight" : "default",
+ "xtype" : "Button",
+ "$ xns" : "Roo.bootstrap",
+ "String html" : "Add",
+ "String glyphicon" : "plus"
+ },
+ {
+ "listeners" : {
+ "render" : "function (_self)\n{\n _this.type_edit_btn = this;\n \n this.hide();\n}",
+ "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}"
+ },
+ "String cls" : "roo-toolbar-button",
+ "String weight" : "default",
+ "xtype" : "Button",
+ "$ xns" : "Roo.bootstrap",
+ "String html" : "Edit",
+ "String glyphicon" : "edit"
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
]
}
},
{
"listeners" : {
- "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.BAdminEnumEdit.show({ \n id : r.data.id\n }, function(res) {\n _this.type_grid.footer.onClick('first');\n });\n}",
+ "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}",
"render" : "function (_self)\n{\n _this.type_grid = _self; \n \n}"
},
"String cls" : "table-fixed",
"boolean hover" : true,
"boolean striped" : false,
"xtype" : "Table",
- "boolean responsive" : true,
"Boolean rowSelection" : true,
"$ xns" : "Roo.bootstrap",
"Boolean loadMask" : true,
"items" : [
{
"listeners" : {
- "selectionchange" : "function (_self)\n{\n _this.option_grid.store.load({});\n}"
+ "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}"
},
"Boolean singleSelect" : true,
"xtype" : "RowSelectionModel",
},
{
"listeners" : {
- "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n o.params['query[empty_etype]'] = 1;\n \n}"
+ "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}",
+ "load" : "function (_self, records, options)\n{\n _this.type_edit_btn.hide();\n}"
},
"$ Object sortInfo" : "{ field : 'display_name', direction: 'ASC' }",
"xtype" : "Store",
},
{
"String header" : "Name",
+ "String cursor" : "pointer",
"String dataIndex" : "display_name",
"xtype" : "ColumnModel",
"Number xs" : 12,
"$ xns" : "Roo.grid",
- "$ renderer" : "function(v,x,r) { \n return String.format('<span tooltip=\"{1}\">{0}</span>', v, r.data.name); \n}",
+ "$ 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}",
"Boolean sortable" : true,
"* prop" : "cm[]"
},
{
- "Number pageSize" : 25,
+ "Number pageSize" : 100,
"Boolean displayInfo" : false,
"xtype" : "PagingToolbar",
"$ xns" : "Roo.bootstrap",
},
{
"listeners" : {
- "activate" : "function (_self)\n{\n if (_this.option_grid) {\n _this.option_grid.store.load({});\n// _this.option_grid.footer.onClick('first');\n }\n}",
+ "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}",
"render" : "function (_self)\n{\n _this.option_panel = _self;\n}"
},
"Boolean fitContainer" : true,
"$ xns" : "Roo.bootstrap",
"items" : [
{
- "Boolean preventDefault" : true,
- "xtype" : "NavSidebarItem",
+ "xtype" : "NavItem",
"$ xns" : "Roo.bootstrap",
- "String html" : "Manage Groups ",
- "String glyphicon" : "menu-hamburger",
"items" : [
{
- "xtype" : "Menu",
+ "xtype" : "Element",
"$ xns" : "Roo.bootstrap",
- "* prop" : "menu",
"items" : [
{
- "listeners" : {
- "click" : "function (_self, e)\n{\n Pman.Dialog.BAdminGroups.show({ id : 0 }, function(res){\n _this.group_grid.store.load({});\n });\n}"
- },
- "Boolean preventDefault" : true,
- "xtype" : "MenuItem",
- "String fa" : "fa fa-plus",
- "$ xns" : "Roo.bootstrap",
- "Boolean isContainer" : false,
- "String html" : "Add"
- },
- {
- "listeners" : {
- "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}"
- },
- "Boolean preventDefault" : true,
- "xtype" : "MenuItem",
- "String fa" : "fa fa-pencil",
- "$ xns" : "Roo.bootstrap",
- "Boolean isContainer" : false,
- "String html" : "Edit"
- },
- {
- "listeners" : {
- "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}"
- },
- "Boolean preventDefault" : true,
- "xtype" : "MenuItem",
- "String fa" : "fa fa-trash",
- "$ xns" : "Roo.bootstrap",
- "Boolean isContainer" : false,
- "String html" : "Delete"
- },
- {
- "listeners" : {
- "click" : "function (_self, e)\n{\n _this.group_grid.store.load({});\n}"
- },
- "Boolean preventDefault" : true,
- "xtype" : "MenuItem",
- "String fa" : "fa fa-refresh",
+ "String cls" : "roo-toolbar",
+ "xtype" : "Row",
"$ xns" : "Roo.bootstrap",
- "Boolean isContainer" : false,
- "String html" : "Reload"
+ "items" : [
+ {
+ "Number md" : 12,
+ "xtype" : "Column",
+ "$ xns" : "Roo.bootstrap",
+ "items" : [
+ {
+ "listeners" : {
+ "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}"
+ },
+ "String cls" : "roo-toolbar-button",
+ "String weight" : "default",
+ "xtype" : "Button",
+ "$ xns" : "Roo.bootstrap",
+ "String html" : "Add",
+ "String glyphicon" : "plus"
+ },
+ {
+ "listeners" : {
+ "render" : "function (_self)\n{\n _this.edit_btn = this;\n \n this.hide();\n}",
+ "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}"
+ },
+ "String cls" : "roo-toolbar-button",
+ "String weight" : "default",
+ "xtype" : "Button",
+ "$ xns" : "Roo.bootstrap",
+ "String html" : "Edit",
+ "String glyphicon" : "edit"
+ },
+ {
+ "listeners" : {
+ "render" : "function (_self)\n{\n _this.delete_btn = this;\n \n this.hide();\n}",
+ "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}"
+ },
+ "String cls" : "roo-toolbar-button",
+ "String weight" : "primary",
+ "xtype" : "Button",
+ "$ xns" : "Roo.bootstrap",
+ "String html" : "Delete",
+ "String glyphicon" : "trash"
+ }
+ ]
+ }
+ ]
}
]
}
},
{
"listeners" : {
+ "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}",
+ "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}",
"render" : "function (_self)\n{\n _this.option_grid = _self; \n\n}"
},
+ "Boolean cellSelection" : true,
"String cls" : "table-fixed",
"Boolean footerShow" : false,
"boolean hover" : true,
"boolean striped" : true,
"xtype" : "Table",
- "boolean responsive" : true,
"Boolean rowSelection" : true,
"$ xns" : "Roo.bootstrap",
"Boolean loadMask" : true,
"* prop" : "grid",
"items" : [
{
+ "listeners" : {
+ "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}"
+ },
"Boolean singleSelect" : true,
"xtype" : "RowSelectionModel",
"$ xns" : "Roo.bootstrap.Table",
},
{
"listeners" : {
- "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}"
+ "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}",
+ "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}",
+ "load" : "function (_self, records, options)\n{\n _this.edit_btn.hide();\n _this.delete_btn.hide();\n}"
},
"xtype" : "Store",
"boolean remoteSort" : true,
"$ xns" : "Roo.data",
- "$ sortinfo" : "{ field : 'display_name', direction: 'ASC' }",
+ "$ sortInfo" : "{ field : 'display_name', direction: 'ASC' }",
"* prop" : "store",
"items" : [
{
},
{
"String header" : "#",
+ "String cursor" : "pointer",
"String dataIndex" : "id",
"Number md" : 2,
"xtype" : "ColumnModel",
"Number xs" : 2,
"$ xns" : "Roo.grid",
- "$ renderer" : "function(v,x,r) { \n return String.format('{0}', v ? v : '');\n}",
+ "$ 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}",
"Boolean sortable" : false,
"* prop" : "cm[]",
"Number sm" : 2
},
{
"String header" : "Name",
+ "String cursor" : "pointer",
"Number md" : 4,
"String dataIndex" : "name",
"xtype" : "ColumnModel",
},
{
"String header" : "Display Name",
+ "String cursor" : "pointer",
"String dataIndex" : "display_name",
"Number md" : 4,
"xtype" : "ColumnModel",
},
{
"String header" : "Active",
+ "String cursor" : "pointer",
"Number md" : 2,
"String dataIndex" : "active",
"xtype" : "ColumnModel",
"Number xs" : 2,
"$ xns" : "Roo.grid",
- "$ 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}",
+ "$ 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}",
"Boolean sortable" : false,
"* prop" : "cm[]",
"Number sm" : 2