_strings : {
'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
'2df80d5febcde0c10a66818488622b7c' :"Pulldown Options",
+ '7dce122004969d56ae2e0245cb754d35' :"Edit",
'01abfc750a0c942167651c40d088531d' :"#",
'dae8ace18bdcbcc6ae5aece263e14fe8' :"Options",
'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
'f2d346b1bb7c1c85ab6f7f21e3666b9f' :"Types",
'49ee3087348e8d44e1feda1917443987' :"Name",
+ 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
'4d3d769b812b6faa6b76e1a8abaece2d' :"Active"
},
listeners : {
activate : function (_self)
{
+ _this.type_edit_btn.hide();
+
if(_this.type_grid) {
_this.type_grid.footer.onClick('first');
}
'|xns' : 'Roo.bootstrap',
items : [
{
- xtype : 'Button',
- glyphicon : 'plus',
- html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
- style : 'margin: 10px;',
- weight : 'primary',
- listeners : {
- click : function (_self, e)
- {
- Pman.Dialog.BAdminCoreEnum.show({
- id : 0
- }, function(res) {
- _this.type_grid.footer.onClick('first');
- });
-
- }
- },
+ xtype : 'Element',
xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Row',
+ cls : 'roo-toolbar',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Column',
+ md : 12,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Button',
+ cls : 'roo-toolbar-button',
+ glyphicon : 'plus',
+ html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
+ weight : 'default',
+ listeners : {
+ click : function (_self, e)
+ {
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : 0
+ }, function(res) {
+ _this.type_grid.footer.onClick('first');
+ });
+
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ },
+ {
+ xtype : 'Button',
+ cls : 'roo-toolbar-button',
+ glyphicon : 'edit',
+ html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
+ weight : 'default',
+ listeners : {
+ click : function (_self, e)
+ {
+ var sel = _this.type_grid.getSelectionModel().getSelected();
+
+ if(!sel || sel.data.id * 1 < 1){
+ Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');
+ return;
+ }
+
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : sel.data.id
+ }, function(res) {
+ _this.type_grid.footer.onClick('first');
+ });
+ },
+ render : function (_self)
+ {
+ _this.type_edit_btn = this;
+
+ this.hide();
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
]
}
cls : 'table-fixed',
hover : true,
loadMask : true,
- responsive : true,
rowSelection : true,
striped : false,
listeners : {
xtype : 'PagingToolbar',
displayInfo : false,
name : 'footer',
- pageSize : 25,
+ pageSize : 100,
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap'
},
listeners : {
beforeload : function (_self, o)
{
+ if (!Pman.buildCompleted) {
+ return false;
+ }
+
o.params = o.params || {};
o.params['query[empty_etype]'] = 1;
+ },
+ load : function (_self, records, options)
+ {
+ _this.type_edit_btn.hide();
}
},
xns : Roo.data,
listeners : {
selectionchange : function (_self)
{
+ _this.type_edit_btn.hide();
+
+ if(this.getSelected()){
+ _this.type_edit_btn.show();
+ }
+
_this.option_grid.store.load({});
}
},
cm : [
{
xtype : 'ColumnModel',
+ cursor : 'pointer',
dataIndex : 'display_name',
header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
- renderer : function(v,x,r) {
+ renderer : function(v,x,r) {
+ if (v.match(/Coba/g) || v.match(/Risk Question/g)) {
+ return String.format('<span tooltip="{1}">Coba: {0}</span>', v, r.data.name);
+ }
+
return String.format('<span tooltip="{1}">{0}</span>', v, r.data.name);
},
sortable : true,
listeners : {
activate : function (_self)
{
+ _this.edit_btn.hide();
+ _this.delete_btn.hide();
+
if (_this.option_grid) {
_this.option_grid.store.load({});
- // _this.option_grid.footer.onClick('first');
}
},
render : function (_self)
'|xns' : 'Roo.bootstrap',
items : [
{
- xtype : 'Button',
- glyphicon : 'plus',
- html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
- style : 'margin: 10px;',
- weight : 'primary',
- listeners : {
- click : function (_self, e)
- {
- var sel = _this.type_grid.getSelectionModel().getSelected();
-
- if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length ){
- return;
- }
-
- Pman.Dialog.BAdminCoreEnum.show({
- id : 0
- }, function(res) {
- _this.type_grid.footer.onClick('first');
- });
-
- }
- },
+ xtype : 'Element',
xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Row',
+ cls : 'roo-toolbar',
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Column',
+ md : 12,
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap',
+ items : [
+ {
+ xtype : 'Button',
+ cls : 'roo-toolbar-button',
+ glyphicon : 'plus',
+ html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
+ weight : 'default',
+ listeners : {
+ click : function (_self, e)
+ {
+ var sel = _this.type_grid.getSelectionModel().getSelected();
+
+ if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length ){
+ Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');
+ return;
+ }
+
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : 0,
+ etype : sel.data.name
+ }, function(res) {
+ _this.option_grid.store.load({});
+ });
+
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ },
+ {
+ xtype : 'Button',
+ cls : 'roo-toolbar-button',
+ glyphicon : 'edit',
+ html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
+ weight : 'default',
+ listeners : {
+ click : function (_self, e)
+ {
+ var sel = _this.option_grid.getSelectionModel().getSelected();
+
+ if(!sel || sel.data.id * 1 < 1){
+ Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
+ return;
+ }
+
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : sel.data.id
+ }, function(res) {
+ _this.option_grid.store.load({});
+ });
+
+ },
+ render : function (_self)
+ {
+ _this.edit_btn = this;
+
+ this.hide();
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ },
+ {
+ xtype : 'Button',
+ cls : 'roo-toolbar-button',
+ glyphicon : 'trash',
+ html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
+ weight : 'primary',
+ listeners : {
+ click : function (_self, e)
+ {
+ var sel = _this.option_grid.getSelectionModel().getSelected();
+
+ if(!sel || sel.data.id * 1 < 1){
+ Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
+ return;
+ }
+
+ new Pman.Request({
+ url: baseURL + '/Roo/Core_enum.php',
+ method : 'POST',
+ params : {
+ _delete : sel.data.id
+ },
+ success : function(res) {
+ _this.option_grid.store.load({});
+ }
+ });
+
+ },
+ render : function (_self)
+ {
+ _this.delete_btn = this;
+
+ this.hide();
+ }
+ },
+ xns : Roo.bootstrap,
+ '|xns' : 'Roo.bootstrap'
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
]
}
},
grid : {
xtype : 'Table',
+ cellSelection : true,
cls : 'table-fixed',
footerShow : false,
hover : true,
loadMask : true,
- responsive : true,
rowSelection : true,
striped : true,
listeners : {
+ cellclick : function (_self, el, rowIndex, columnIndex, e)
+ {
+ var di = _this.option_grid.colModel.getDataIndex(columnIndex);
+
+ if (di != 'active') {
+ return;
+ }
+
+ var rec = _this.option_grid.store.getAt(rowIndex);
+
+ rec.set('active', rec.data.active ? 0 : 1);
+
+ rec.commit();
+
+ /*if(rec.data.active * 1 != 1){
+ var el = _this.option_grid.getRowDom(rowIndex);
+
+ el.addClass('x-grid-row-fadeout');
+
+ el.on('transitionend',function(){
+ _this.option_grid.ds.remove(rec);
+ el.remove();
+ },this,{single:true});
+ }*/
+ },
render : function (_self)
{
_this.option_grid = _self;
+ },
+ rowdblclick : function (_self, el, rowIndex, e)
+ {
+ var sel = _this.option_grid.store.getAt(rowIndex);
+
+ if(!sel || sel.data.id * 1 < 1){
+ return;
+ }
+
+ Pman.Dialog.BAdminCoreEnum.show({
+ id : sel.data.id
+ }, function(res) {
+ _this.option_grid.store.load({});
+ });
+
}
},
xns : Roo.bootstrap,
store : {
xtype : 'Store',
remoteSort : true,
- sortinfo : { field : 'display_name', direction: 'ASC' },
+ sortInfo : { field : 'display_name', direction: 'ASC' },
listeners : {
beforeload : function (_self, o)
{
+ if (!Pman.buildCompleted) {
+ return false;
+ }
+
o.params = o.params || {};
var sel = _this.type_grid.getSelectionModel().getSelected();
o.params.etype = sel.data.name;
+ },
+ load : function (_self, records, options)
+ {
+ _this.edit_btn.hide();
+ _this.delete_btn.hide();
+ },
+ update : function (_self, record, operation)
+ {
+ if (operation != 'commit') {
+ return;
+ }
+
+ new Pman.Request({
+ url : baseURL + '/Roo/Core_enum',
+ method :'POST',
+ params : {
+ id : record.data.id,
+ active: record.data.active
+ },
+ success : function() {
+
+ },
+ failure : function()
+ {
+ Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ });
}
},
xns : Roo.data,
sm : {
xtype : 'RowSelectionModel',
singleSelect : true,
+ listeners : {
+ selectionchange : function (_self)
+ {
+ _this.edit_btn.hide();
+ _this.delete_btn.hide();
+
+ if (!this.getSelected()) {
+ return;
+ }
+
+ _this.edit_btn.show();
+ _this.delete_btn.show();
+
+ }
+ },
xns : Roo.bootstrap.Table,
'|xns' : 'Roo.bootstrap.Table'
},
cm : [
{
xtype : 'ColumnModel',
+ cursor : 'pointer',
dataIndex : 'id',
header : _this._strings['01abfc750a0c942167651c40d088531d'] /* # */,
md : 2,
- renderer : function(v,x,r) {
- return String.format('{0}', v ? v : '');
+ renderer : function(v,x,r) {
+ //console.log(r.data.seqid);
+ //return String.format('{0}', v ? v : '');
+
+ return
+ String.format('{0}', r.data.seqid ? r.data.seqid : '')
+ +" <span style='color:lightgrey'>"
+ + String.format('{0}', r.data.id ? r.data.id : '')
+ +"</span>";
},
sm : 2,
sortable : false,
},
{
xtype : 'ColumnModel',
+ cursor : 'pointer',
dataIndex : 'name',
header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
md : 4,
},
{
xtype : 'ColumnModel',
+ cursor : 'pointer',
dataIndex : 'display_name',
header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
md : 4,
},
{
xtype : 'ColumnModel',
+ cursor : 'pointer',
dataIndex : 'active',
header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
md : 2,
renderer : function(v,x,r) {
- var state = v > 0 ? '-checked' : '';
-
- return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
+
+ var state = v > 0 ? 'check-' : '';
+
+ //return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';
+ return '<i class="far fa-'+ state + 'square-o fa-2x" aria-hidden="true"></i>';
},
sm : 2,
sortable : false,