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,
189 render : function (_self)
191 _this.type_grid = _self;
194 rowdblclick : function (_self, el, rowIndex, e)
196 var r = _this.type_grid.store.getAt(rowIndex);
198 if(!r || r.data.id * 1 < 1){
202 Pman.Dialog.BAdminCoreEnum.show({
205 _this.type_grid.footer.onClick('first');
210 '|xns' : 'Roo.bootstrap',
212 xtype : 'PagingToolbar',
217 '|xns' : 'Roo.bootstrap'
222 sortInfo : { field : 'display_name', direction: 'ASC' },
224 beforeload : function (_self, o)
226 if (!Pman.buildCompleted) {
230 o.params = o.params || {};
232 o.params['query[empty_etype]'] = 1;
235 load : function (_self, records, options)
237 _this.type_edit_btn.hide();
245 url : baseURL + '/Roo/core_enum.php',
250 xtype : 'JsonReader',
265 'name': 'display_name',
279 totalProperty : 'total',
285 xtype : 'RowSelectionModel',
288 selectionchange : function (_self)
290 _this.type_edit_btn.hide();
292 if(this.getSelected()){
293 _this.type_edit_btn.show();
296 _this.option_grid.store.load({});
299 xns : Roo.bootstrap.Table,
300 '|xns' : 'Roo.bootstrap.Table'
304 xtype : 'ColumnModel',
306 dataIndex : 'display_name',
307 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
308 renderer : function(v,x,r) {
309 if (v.match(/Coba/g) || v.match(/Risk Question/g)) {
310 return String.format('<span tooltip="{1}">Coba: {0}</span>', v, r.data.name);
313 return String.format('<span tooltip="{1}">{0}</span>', v, r.data.name);
329 title : _this._strings['dae8ace18bdcbcc6ae5aece263e14fe8'] /* Options */,
331 activate : function (_self)
333 _this.edit_btn.hide();
334 _this.delete_btn.hide();
336 if (_this.option_grid) {
337 _this.option_grid.store.load({});
340 render : function (_self)
342 _this.option_panel = _self;
345 xns : Roo.bootstrap.panel,
346 '|xns' : 'Roo.bootstrap.panel',
348 xtype : 'NavSimplebar',
350 '|xns' : 'Roo.bootstrap',
355 '|xns' : 'Roo.bootstrap',
360 '|xns' : 'Roo.bootstrap',
365 '|xns' : 'Roo.bootstrap',
371 '|xns' : 'Roo.bootstrap',
377 '|xns' : 'Roo.bootstrap',
381 cls : 'roo-toolbar-button',
383 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
386 click : function (_self, e)
388 var sel = _this.type_grid.getSelectionModel().getSelected();
390 if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length ){
391 Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');
395 Pman.Dialog.BAdminCoreEnum.show({
397 etype : sel.data.name
399 _this.option_grid.store.load({});
405 '|xns' : 'Roo.bootstrap'
409 cls : 'roo-toolbar-button',
411 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
414 click : function (_self, e)
416 var sel = _this.option_grid.getSelectionModel().getSelected();
418 if(!sel || sel.data.id * 1 < 1){
419 Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
423 Pman.Dialog.BAdminCoreEnum.show({
426 _this.option_grid.store.load({});
430 render : function (_self)
432 _this.edit_btn = this;
438 '|xns' : 'Roo.bootstrap'
442 cls : 'roo-toolbar-button',
444 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
447 click : function (_self, e)
449 var sel = _this.option_grid.getSelectionModel().getSelected();
451 if(!sel || sel.data.id * 1 < 1){
452 Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
457 url: baseURL + '/Roo/Core_enum.php',
460 _delete : sel.data.id
462 success : function(res) {
463 _this.option_grid.store.load({});
468 render : function (_self)
470 _this.delete_btn = this;
476 '|xns' : 'Roo.bootstrap'
492 cellSelection : true,
500 cellclick : function (_self, el, rowIndex, columnIndex, e)
502 var di = _this.option_grid.colModel.getDataIndex(columnIndex);
504 if (di != 'active') {
508 var rec = _this.option_grid.store.getAt(rowIndex);
510 rec.set('active', rec.data.active ? 0 : 1);
514 /*if(rec.data.active * 1 != 1){
515 var el = _this.option_grid.getRowDom(rowIndex);
517 el.addClass('x-grid-row-fadeout');
519 el.on('transitionend',function(){
520 _this.option_grid.ds.remove(rec);
522 },this,{single:true});
525 render : function (_self)
527 _this.option_grid = _self;
530 rowdblclick : function (_self, el, rowIndex, e)
532 var sel = _this.option_grid.store.getAt(rowIndex);
534 if(!sel || sel.data.id * 1 < 1){
538 Pman.Dialog.BAdminCoreEnum.show({
541 _this.option_grid.store.load({});
547 '|xns' : 'Roo.bootstrap',
551 sortInfo : { field : 'display_name', direction: 'ASC' },
553 beforeload : function (_self, o)
555 if (!Pman.buildCompleted) {
559 o.params = o.params || {};
561 var sel = _this.type_grid.getSelectionModel().getSelected();
563 if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length){
568 o.params.etype = sel.data.name;
571 load : function (_self, records, options)
573 _this.edit_btn.hide();
574 _this.delete_btn.hide();
576 update : function (_self, record, operation)
578 if (operation != 'commit') {
583 url : baseURL + '/Roo/Core_enum',
587 active: record.data.active
589 success : function() {
594 Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
595 _this.grid.footer.onClick('first');
606 url : baseURL + '/Roo/core_enum.php',
611 xtype : 'JsonReader',
626 'name': 'display_name',
640 totalProperty : 'total',
646 xtype : 'RowSelectionModel',
649 selectionchange : function (_self)
651 _this.edit_btn.hide();
652 _this.delete_btn.hide();
654 if (!this.getSelected()) {
658 _this.edit_btn.show();
659 _this.delete_btn.show();
663 xns : Roo.bootstrap.Table,
664 '|xns' : 'Roo.bootstrap.Table'
668 xtype : 'ColumnModel',
671 header : _this._strings['01abfc750a0c942167651c40d088531d'] /* # */,
673 renderer : function(v,x,r) {
674 //console.log(r.data.seqid);
675 //return String.format('{0}', v ? v : '');
678 String.format('{0}', r.data.seqid ? r.data.seqid : '')
679 +" <span style='color:lightgrey'>"
680 + String.format('{0}', r.data.id ? r.data.id : '')
690 xtype : 'ColumnModel',
693 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
695 renderer : function(v,x,r) {
696 return String.format('{0}', v ? v : '');
705 xtype : 'ColumnModel',
707 dataIndex : 'display_name',
708 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
710 renderer : function(v,x,r) {
711 return String.format('{0}', v ? v : '');
720 xtype : 'ColumnModel',
722 dataIndex : 'active',
723 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
725 renderer : function(v,x,r) {
727 var state = v > 0 ? 'check-' : '';
729 //return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';
730 return '<i class="far fa-'+ state + 'square-o fa-2x" aria-hidden="true"></i>';