1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.BAdminCoreEnum = new Roo.XComponent({
10 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
11 '2df80d5febcde0c10a66818488622b7c' :"Pulldown Options",
12 '7dce122004969d56ae2e0245cb754d35' :"Edit",
13 '01abfc750a0c942167651c40d088531d' :"#",
14 'dae8ace18bdcbcc6ae5aece263e14fe8' :"Options",
15 'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
16 'f2d346b1bb7c1c85ab6f7f21e3666b9f' :"Types",
17 '49ee3087348e8d44e1feda1917443987' :"Name",
18 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
19 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active"
22 part : ["BAdmin", "CoreEnum" ],
23 order : '005-Pman.Tab.BAdminCoreEnum',
25 parent : 'Pman.Tab.BAdmin',
26 name : "unnamed module",
29 _tree : function(_data)
36 title : _this._strings['2df80d5febcde0c10a66818488622b7c'] /* Pulldown Options */,
37 xns : Roo.bootstrap.panel,
38 '|xns' : 'Roo.bootstrap.panel',
41 xns : Roo.bootstrap.layout,
42 '|xns' : 'Roo.bootstrap.layout',
47 xns : Roo.bootstrap.layout,
48 '|xns' : 'Roo.bootstrap.layout'
56 xns : Roo.bootstrap.layout,
57 '|xns' : 'Roo.bootstrap.layout'
67 title : _this._strings['f2d346b1bb7c1c85ab6f7f21e3666b9f'] /* Types */,
69 activate : function (_self)
71 _this.type_edit_btn.hide();
74 _this.type_grid.footer.onClick('first');
77 render : function (_self)
79 _this.type_panel = _self;
82 xns : Roo.bootstrap.panel,
83 '|xns' : 'Roo.bootstrap.panel',
85 xtype : 'NavSimplebar',
87 '|xns' : 'Roo.bootstrap',
92 '|xns' : 'Roo.bootstrap',
97 '|xns' : 'Roo.bootstrap',
102 '|xns' : 'Roo.bootstrap',
108 '|xns' : 'Roo.bootstrap',
114 '|xns' : 'Roo.bootstrap',
118 cls : 'roo-toolbar-button',
120 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
123 click : function (_self, e)
125 Pman.Dialog.BAdminCoreEnum.show({
128 _this.type_grid.footer.onClick('first');
134 '|xns' : 'Roo.bootstrap'
138 cls : 'roo-toolbar-button',
140 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
143 click : function (_self, e)
145 var sel = _this.type_grid.getSelectionModel().getSelected();
147 if(!sel || sel.data.id * 1 < 1){
148 Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');
152 Pman.Dialog.BAdminCoreEnum.show({
155 _this.type_grid.footer.onClick('first');
158 render : function (_self)
160 _this.type_edit_btn = this;
166 '|xns' : 'Roo.bootstrap'
182 cellSelection : true,
190 render : function (_self)
192 _this.type_grid = _self;
195 rowdblclick : function (_self, el, rowIndex, e)
197 var r = _this.type_grid.store.getAt(rowIndex);
199 if(!r || r.data.id * 1 < 1){
203 Pman.Dialog.BAdminCoreEnum.show({
206 _this.type_grid.footer.onClick('first');
211 '|xns' : 'Roo.bootstrap',
213 xtype : 'PagingToolbar',
218 '|xns' : 'Roo.bootstrap'
223 sortInfo : { field : 'display_name', direction: 'ASC' },
225 beforeload : function (_self, o)
227 if (!Pman.buildCompleted) {
231 o.params = o.params || {};
233 o.params['query[empty_etype]'] = 1;
236 load : function (_self, records, options)
238 _this.type_edit_btn.hide();
246 url : baseURL + '/Roo/core_enum.php',
251 xtype : 'JsonReader',
266 'name': 'display_name',
280 totalProperty : 'total',
286 xtype : 'RowSelectionModel',
289 selectionchange : function (_self)
291 _this.type_edit_btn.hide();
293 if(this.getSelected()){
294 _this.type_edit_btn.show();
297 _this.option_grid.store.load({});
300 xns : Roo.bootstrap.Table,
301 '|xns' : 'Roo.bootstrap.Table'
305 xtype : 'ColumnModel',
307 dataIndex : 'display_name',
308 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
309 renderer : function(v,x,r) {
310 if (v.match(/Coba/g) || v.match(/Risk Question/g)) {
311 return String.format('<span tooltip="{1}">Coba: {0}</span>', v, r.data.name);
314 return String.format('<span tooltip="{1}">{0}</span>', v, r.data.name);
330 title : _this._strings['dae8ace18bdcbcc6ae5aece263e14fe8'] /* Options */,
332 activate : function (_self)
334 _this.edit_btn.hide();
335 _this.delete_btn.hide();
337 if (_this.option_grid) {
338 _this.option_grid.store.load({});
341 render : function (_self)
343 _this.option_panel = _self;
346 xns : Roo.bootstrap.panel,
347 '|xns' : 'Roo.bootstrap.panel',
349 xtype : 'NavSimplebar',
351 '|xns' : 'Roo.bootstrap',
356 '|xns' : 'Roo.bootstrap',
361 '|xns' : 'Roo.bootstrap',
366 '|xns' : 'Roo.bootstrap',
372 '|xns' : 'Roo.bootstrap',
378 '|xns' : 'Roo.bootstrap',
382 cls : 'roo-toolbar-button',
384 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
387 click : function (_self, e)
389 var sel = _this.type_grid.getSelectionModel().getSelected();
391 if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length ){
392 Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');
396 Pman.Dialog.BAdminCoreEnum.show({
398 etype : sel.data.name
400 _this.option_grid.store.load({});
406 '|xns' : 'Roo.bootstrap'
410 cls : 'roo-toolbar-button',
412 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
415 click : function (_self, e)
417 var sel = _this.option_grid.getSelectionModel().getSelected();
419 if(!sel || sel.data.id * 1 < 1){
420 Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
424 Pman.Dialog.BAdminCoreEnum.show({
427 _this.option_grid.store.load({});
431 render : function (_self)
433 _this.edit_btn = this;
439 '|xns' : 'Roo.bootstrap'
443 cls : 'roo-toolbar-button',
445 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
448 click : function (_self, e)
450 var sel = _this.option_grid.getSelectionModel().getSelected();
452 if(!sel || sel.data.id * 1 < 1){
453 Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
458 url: baseURL + '/Roo/Core_enum.php',
461 _delete : sel.data.id
463 success : function(res) {
464 _this.option_grid.store.load({});
469 render : function (_self)
471 _this.delete_btn = this;
477 '|xns' : 'Roo.bootstrap'
493 cellSelection : true,
502 cellclick : function (_self, el, rowIndex, columnIndex, e)
504 var di = _this.option_grid.colModel.getDataIndex(columnIndex);
506 if (di != 'active') {
510 var rec = _this.option_grid.store.getAt(rowIndex);
512 rec.set('active', rec.data.active ? 0 : 1);
516 /*if(rec.data.active * 1 != 1){
517 var el = _this.option_grid.getRowDom(rowIndex);
519 el.addClass('x-grid-row-fadeout');
521 el.on('transitionend',function(){
522 _this.option_grid.ds.remove(rec);
524 },this,{single:true});
527 render : function (_self)
529 _this.option_grid = _self;
532 rowdblclick : function (_self, el, rowIndex, e)
534 var sel = _this.option_grid.store.getAt(rowIndex);
536 if(!sel || sel.data.id * 1 < 1){
540 Pman.Dialog.BAdminCoreEnum.show({
543 _this.option_grid.store.load({});
549 '|xns' : 'Roo.bootstrap',
553 sortInfo : { field : 'display_name', direction: 'ASC' },
555 beforeload : function (_self, o)
557 if (!Pman.buildCompleted) {
561 o.params = o.params || {};
563 var sel = _this.type_grid.getSelectionModel().getSelected();
565 if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length){
570 o.params.etype = sel.data.name;
573 load : function (_self, records, options)
575 _this.edit_btn.hide();
576 _this.delete_btn.hide();
578 update : function (_self, record, operation)
580 if (operation != 'commit') {
585 url : baseURL + '/Roo/Core_enum',
589 active: record.data.active
591 success : function() {
596 Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
597 _this.grid.footer.onClick('first');
608 url : baseURL + '/Roo/core_enum.php',
613 xtype : 'JsonReader',
628 'name': 'display_name',
642 totalProperty : 'total',
648 xtype : 'RowSelectionModel',
651 selectionchange : function (_self)
653 _this.edit_btn.hide();
654 _this.delete_btn.hide();
656 if (!this.getSelected()) {
660 _this.edit_btn.show();
661 _this.delete_btn.show();
665 xns : Roo.bootstrap.Table,
666 '|xns' : 'Roo.bootstrap.Table'
670 xtype : 'ColumnModel',
673 header : _this._strings['01abfc750a0c942167651c40d088531d'] /* # */,
675 renderer : function(v,x,r) {
676 //console.log(r.data.seqid);
677 //return String.format('{0}', v ? v : '');
680 String.format('{0}', r.data.seqid ? r.data.seqid : '')
681 +" <span style='color:lightgrey'>"
682 + String.format('{0}', r.data.id ? r.data.id : '')
692 xtype : 'ColumnModel',
695 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
697 renderer : function(v,x,r) {
698 return String.format('{0}', v ? v : '');
707 xtype : 'ColumnModel',
709 dataIndex : 'display_name',
710 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
712 renderer : function(v,x,r) {
713 return String.format('{0}', v ? v : '');
722 xtype : 'ColumnModel',
724 dataIndex : 'active',
725 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
727 renderer : function(v,x,r) {
729 var state = v > 0 ? 'check-' : '';
731 //return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';
732 return '<i class="far fa-'+ state + 'square-o fa-2x" aria-hidden="true"></i>';