{
"name" : "Pman.Tab.BAdminCoreEnum",
"parent" : "Pman.Tab.BAdmin",
"title" : "",
"path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Tab.BAdminCoreEnum.bjs",
"permname" : "",
"modOrder" : "005",
"strings" : {
"ec211f7c20af43e742bf2570c3cb84f9" : "Add",
"2df80d5febcde0c10a66818488622b7c" : "Pulldown Options",
"7dce122004969d56ae2e0245cb754d35" : "Edit",
"01abfc750a0c942167651c40d088531d" : "#",
"dae8ace18bdcbcc6ae5aece263e14fe8" : "Options",
"b48968e1c912da07df5e8d6d246291ec" : "Display Name",
"f2d346b1bb7c1c85ab6f7f21e3666b9f" : "Types",
"49ee3087348e8d44e1feda1917443987" : "Name",
"f2a6c498fb90ee345d997f888fce3b18" : "Delete",
"4d3d769b812b6faa6b76e1a8abaece2d" : "Active"
},
"items" : [
{
"xtype" : "Nest",
"$ xns" : "Roo.bootstrap.panel",
"String title" : "Pulldown Options",
"Boolean background" : true,
"items" : [
{
"xtype" : "Border",
"$ xns" : "Roo.bootstrap.layout",
"* prop" : "layout",
"items" : [
{
"String tabPosition" : "top",
"Boolean hideTabs" : true,
"xtype" : "Region",
"$ xns" : "Roo.bootstrap.layout",
"* prop" : "center"
},
{
"String tabPosition" : "top",
"Number width" : 350,
"xtype" : "Region",
"Boolean hideTabs" : true,
"$ xns" : "Roo.bootstrap.layout",
"* prop" : "west",
"Boolean split" : true
},
{
"listeners" : {
"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,
"xtype" : "Grid",
"Boolean fitToFrame" : true,
"String region" : "west",
"$ xns" : "Roo.bootstrap.panel",
"String title" : "Types",
"Boolean background" : false,
"Boolean closable" : false,
"items" : [
{
"xtype" : "NavSimplebar",
"$ xns" : "Roo.bootstrap",
"* prop" : "toolbar",
"items" : [
{
"xtype" : "NavGroup",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"xtype" : "NavItem",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"xtype" : "Element",
"$ xns" : "Roo.bootstrap",
"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.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 cellSelection" : true,
"boolean hover" : true,
"boolean striped" : false,
"xtype" : "Table",
"boolean responsive" : true,
"Boolean rowSelection" : true,
"$ xns" : "Roo.bootstrap",
"Boolean loadMask" : true,
"* prop" : "grid",
"items" : [
{
"listeners" : {
"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",
"$ xns" : "Roo.bootstrap.Table",
"* prop" : "sm"
},
{
"listeners" : {
"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",
"boolean remoteSort" : true,
"$ xns" : "Roo.data",
"* prop" : "store",
"items" : [
{
"$ 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]",
"xtype" : "JsonReader",
"String root" : "data",
"$ xns" : "Roo.data",
"String id" : "id",
"* prop" : "reader",
"String totalProperty" : "total"
},
{
"$ url" : "baseURL + '/Roo/core_enum.php'",
"xtype" : "HttpProxy",
"$ xns" : "Roo.data",
"String method" : "GET",
"* prop" : "proxy"
}
]
},
{
"String header" : "Name",
"String cursor" : "pointer",
"String dataIndex" : "display_name",
"xtype" : "ColumnModel",
"Number xs" : 12,
"$ xns" : "Roo.grid",
"$ renderer" : "function(v,x,r) {\n if (v.match(/Coba/g) || v.match(/Risk Question/g)) {\n return String.format('Coba: {0}', v, r.data.name);\n }\n \n return String.format('{0}', v, r.data.name); \n}",
"Boolean sortable" : true,
"* prop" : "cm[]"
},
{
"Number pageSize" : 100,
"Boolean displayInfo" : false,
"xtype" : "PagingToolbar",
"$ xns" : "Roo.bootstrap",
"* prop" : "footer",
"string name" : "footer"
}
]
}
]
},
{
"listeners" : {
"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,
"xtype" : "Grid",
"Boolean fitToFrame" : true,
"String region" : "center",
"$ xns" : "Roo.bootstrap.panel",
"String title" : "Options",
"Boolean background" : false,
"items" : [
{
"xtype" : "NavSimplebar",
"$ xns" : "Roo.bootstrap",
"* prop" : "toolbar",
"items" : [
{
"xtype" : "NavGroup",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"xtype" : "NavItem",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"xtype" : "Element",
"$ xns" : "Roo.bootstrap",
"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 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}"
},
"String cls" : "table-fixed",
"Boolean footerShow" : false,
"Boolean cellSelection" : true,
"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",
"* prop" : "sm"
},
{
"listeners" : {
"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' }",
"* prop" : "store",
"items" : [
{
"$ 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]",
"xtype" : "JsonReader",
"String root" : "data",
"$ xns" : "Roo.data",
"String id" : "id",
"* prop" : "reader",
"String totalProperty" : "total"
},
{
"$ url" : "baseURL + '/Roo/core_enum.php'",
"xtype" : "HttpProxy",
"$ xns" : "Roo.data",
"String method" : "GET",
"* prop" : "proxy"
}
]
},
{
"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 //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 +\" \"\n + String.format('{0}', r.data.id ? r.data.id : '')\n +\"\";\n}",
"Boolean sortable" : false,
"* prop" : "cm[]",
"Number sm" : 2
},
{
"String header" : "Name",
"String cursor" : "pointer",
"Number md" : 4,
"String dataIndex" : "name",
"xtype" : "ColumnModel",
"Number xs" : 4,
"$ xns" : "Roo.grid",
"$ renderer" : "function(v,x,r) { \n return String.format('{0}', v ? v : '');\n}",
"Boolean sortable" : false,
"* prop" : "cm[]",
"Number sm" : 4
},
{
"String header" : "Display Name",
"String cursor" : "pointer",
"String dataIndex" : "display_name",
"Number md" : 4,
"xtype" : "ColumnModel",
"Number xs" : 4,
"$ xns" : "Roo.grid",
"$ renderer" : "function(v,x,r) { \n return String.format('{0}', v ? v : '');\n}",
"Boolean sortable" : false,
"* prop" : "cm[]",
"Number sm" : 4
},
{
"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 \n var state = v > 0 ? 'check-' : '';\n \n //return '';\n return '';\n}",
"Boolean sortable" : false,
"* prop" : "cm[]",
"Number sm" : 2
}
]
}
]
}
]
}
]
}
]
}