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 render : function (_self)
518 _this.option_grid = _self;
521 rowdblclick : function (_self, el, rowIndex, e)
523 var sel = _this.option_grid.store.getAt(rowIndex);
525 if(!sel || sel.data.id * 1 < 1){
529 Pman.Dialog.BAdminCoreEnum.show({
532 _this.option_grid.store.load({});
538 '|xns' : 'Roo.bootstrap',
542 sortinfo : { field : 'display_name', direction: 'ASC' },
544 beforeload : function (_self, o)
546 if (!Pman.buildCompleted) {
550 o.params = o.params || {};
552 var sel = _this.type_grid.getSelectionModel().getSelected();
554 if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length){
559 o.params.etype = sel.data.name;
562 load : function (_self, records, options)
564 _this.edit_btn.hide();
565 _this.delete_btn.hide();
567 update : function (_self, record, operation)
569 if (operation != 'commit') {
574 url : baseURL + '/Roo/Core_enum',
578 active: record.data.active
580 success : function() {
585 Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
586 _this.grid.footer.onClick('first');
597 url : baseURL + '/Roo/core_enum.php',
602 xtype : 'JsonReader',
617 'name': 'display_name',
631 totalProperty : 'total',
637 xtype : 'RowSelectionModel',
640 selectionchange : function (_self)
642 _this.edit_btn.hide();
643 _this.delete_btn.hide();
645 if (!this.getSelected()) {
649 _this.edit_btn.show();
650 _this.delete_btn.show();
654 xns : Roo.bootstrap.Table,
655 '|xns' : 'Roo.bootstrap.Table'
659 xtype : 'ColumnModel',
662 header : _this._strings['01abfc750a0c942167651c40d088531d'] /* # */,
664 renderer : function(v,x,r) {
665 //console.log(r.data.seqid);
666 //return String.format('{0}', v ? v : '');
669 String.format('{0}', r.data.seqid ? r.data.seqid : '')
670 +" <span style='color:lightgrey'>"
671 + String.format('{0}', r.data.id ? r.data.id : '')
681 xtype : 'ColumnModel',
684 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
686 renderer : function(v,x,r) {
687 return String.format('{0}', v ? v : '');
696 xtype : 'ColumnModel',
698 dataIndex : 'display_name',
699 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
701 renderer : function(v,x,r) {
702 return String.format('{0}', v ? v : '');
711 xtype : 'ColumnModel',
713 dataIndex : 'active',
714 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
716 renderer : function(v,x,r) {
717 var state = v > 0 ? '-checked' : '';
719 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';