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.BAdminIPAccess = new Roo.XComponent({
10 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
11 '7dce122004969d56ae2e0245cb754d35' :"Edit",
12 '01abfc750a0c942167651c40d088531d' :"#",
13 'dae8ace18bdcbcc6ae5aece263e14fe8' :"Options",
14 'b48968e1c912da07df5e8d6d246291ec' :"Display Name",
15 'f2d346b1bb7c1c85ab6f7f21e3666b9f' :"Types",
16 '49ee3087348e8d44e1feda1917443987' :"Name",
17 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
18 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
19 'e3030abfa75de4573fb37032affa11e7' :"IP Access"
22 part : ["BAdmin", "IPAccess" ],
23 order : '006-Pman.Tab.BAdminIPAccess',
26 name : "unnamed module",
29 _tree : function(_data)
36 title : _this._strings['e3030abfa75de4573fb37032affa11e7'] /* IP Access */,
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'
58 title : _this._strings['f2d346b1bb7c1c85ab6f7f21e3666b9f'] /* Types */,
60 activate : function (_self)
62 _this.type_edit_btn.hide();
65 _this.type_grid.footer.onClick('first');
68 render : function (_self)
70 _this.type_panel = _self;
73 xns : Roo.bootstrap.panel,
74 '|xns' : 'Roo.bootstrap.panel',
76 xtype : 'NavSimplebar',
78 '|xns' : 'Roo.bootstrap',
83 '|xns' : 'Roo.bootstrap',
88 '|xns' : 'Roo.bootstrap',
93 '|xns' : 'Roo.bootstrap',
99 '|xns' : 'Roo.bootstrap',
105 '|xns' : 'Roo.bootstrap',
109 cls : 'roo-toolbar-button',
111 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
114 click : function (_self, e)
116 Pman.Dialog.BAdminCoreEnum.show({
119 _this.type_grid.footer.onClick('first');
125 '|xns' : 'Roo.bootstrap'
129 cls : 'roo-toolbar-button',
131 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
134 click : function (_self, e)
136 var sel = _this.type_grid.getSelectionModel().getSelected();
138 if(!sel || sel.data.id * 1 < 1){
139 Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');
143 Pman.Dialog.BAdminCoreEnum.show({
146 _this.type_grid.footer.onClick('first');
149 render : function (_self)
151 _this.type_edit_btn = this;
157 '|xns' : 'Roo.bootstrap'
173 cellSelection : true,
181 render : function (_self)
183 _this.type_grid = _self;
186 rowdblclick : function (_self, el, rowIndex, e)
188 var r = _this.type_grid.store.getAt(rowIndex);
190 if(!r || r.data.id * 1 < 1){
194 Pman.Dialog.BAdminCoreEnum.show({
197 _this.type_grid.footer.onClick('first');
202 '|xns' : 'Roo.bootstrap',
204 xtype : 'PagingToolbar',
209 '|xns' : 'Roo.bootstrap'
214 sortInfo : { field : 'display_name', direction: 'ASC' },
216 beforeload : function (_self, o)
218 o.params = o.params || {};
220 o.params['query[empty_etype]'] = 1;
223 load : function (_self, records, options)
225 _this.type_edit_btn.hide();
233 url : baseURL + '/Roo/core_enum.php',
238 xtype : 'JsonReader',
253 'name': 'display_name',
267 totalProperty : 'total',
273 xtype : 'RowSelectionModel',
276 selectionchange : function (_self)
278 _this.type_edit_btn.hide();
280 if(this.getSelected()){
281 _this.type_edit_btn.show();
284 _this.option_grid.store.load({});
287 xns : Roo.bootstrap.Table,
288 '|xns' : 'Roo.bootstrap.Table'
292 xtype : 'ColumnModel',
294 dataIndex : 'display_name',
295 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
296 renderer : function(v,x,r) {
297 if (v.match(/Coba/g) || v.match(/Risk Question/g)) {
298 return String.format('<span tooltip="{1}">Coba: {0}</span>', v, r.data.name);
301 return String.format('<span tooltip="{1}">{0}</span>', v, r.data.name);
317 title : _this._strings['dae8ace18bdcbcc6ae5aece263e14fe8'] /* Options */,
319 activate : function (_self)
321 _this.edit_btn.hide();
322 _this.delete_btn.hide();
324 if (_this.option_grid) {
325 _this.option_grid.store.load({});
328 render : function (_self)
330 _this.option_panel = _self;
333 xns : Roo.bootstrap.panel,
334 '|xns' : 'Roo.bootstrap.panel',
336 xtype : 'NavSimplebar',
338 '|xns' : 'Roo.bootstrap',
343 '|xns' : 'Roo.bootstrap',
348 '|xns' : 'Roo.bootstrap',
353 '|xns' : 'Roo.bootstrap',
359 '|xns' : 'Roo.bootstrap',
365 '|xns' : 'Roo.bootstrap',
369 cls : 'roo-toolbar-button',
371 html : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
374 click : function (_self, e)
376 var sel = _this.type_grid.getSelectionModel().getSelected();
378 if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length ){
379 Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');
383 Pman.Dialog.BAdminCoreEnum.show({
385 etype : sel.data.name
387 _this.option_grid.store.load({});
393 '|xns' : 'Roo.bootstrap'
397 cls : 'roo-toolbar-button',
399 html : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
402 click : function (_self, e)
404 var sel = _this.option_grid.getSelectionModel().getSelected();
406 if(!sel || sel.data.id * 1 < 1){
407 Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
411 Pman.Dialog.BAdminCoreEnum.show({
414 _this.option_grid.store.load({});
418 render : function (_self)
420 _this.edit_btn = this;
426 '|xns' : 'Roo.bootstrap'
430 cls : 'roo-toolbar-button',
432 html : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
435 click : function (_self, e)
437 var sel = _this.option_grid.getSelectionModel().getSelected();
439 if(!sel || sel.data.id * 1 < 1){
440 Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');
445 url: baseURL + '/Roo/Core_enum.php',
448 _delete : sel.data.id
450 success : function(res) {
451 _this.option_grid.store.load({});
456 render : function (_self)
458 _this.delete_btn = this;
464 '|xns' : 'Roo.bootstrap'
480 cellSelection : true,
489 cellclick : function (_self, el, rowIndex, columnIndex, e)
491 var di = _this.option_grid.colModel.getDataIndex(columnIndex);
493 if (di != 'active') {
497 var rec = _this.option_grid.store.getAt(rowIndex);
499 rec.set('active', rec.data.active ? 0 : 1);
503 render : function (_self)
505 _this.option_grid = _self;
508 rowdblclick : function (_self, el, rowIndex, e)
510 var sel = _this.option_grid.store.getAt(rowIndex);
512 if(!sel || sel.data.id * 1 < 1){
516 Pman.Dialog.BAdminCoreEnum.show({
519 _this.option_grid.store.load({});
525 '|xns' : 'Roo.bootstrap',
529 sortinfo : { field : 'display_name', direction: 'ASC' },
531 beforeload : function (_self, o)
533 o.params = o.params || {};
535 var sel = _this.type_grid.getSelectionModel().getSelected();
537 if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length){
542 o.params.etype = sel.data.name;
545 load : function (_self, records, options)
547 _this.edit_btn.hide();
548 _this.delete_btn.hide();
550 update : function (_self, record, operation)
552 if (operation != 'commit') {
557 url : baseURL + '/Roo/Core_enum',
561 active: record.data.active
563 success : function() {
568 Roo.bootstrap.MessageBox.alert("Error", "saving failed", function() {
569 _this.grid.footer.onClick('first');
580 url : baseURL + '/Roo/core_enum.php',
585 xtype : 'JsonReader',
600 'name': 'display_name',
614 totalProperty : 'total',
620 xtype : 'RowSelectionModel',
623 selectionchange : function (_self)
625 _this.edit_btn.hide();
626 _this.delete_btn.hide();
628 if (!this.getSelected()) {
632 _this.edit_btn.show();
633 _this.delete_btn.show();
637 xns : Roo.bootstrap.Table,
638 '|xns' : 'Roo.bootstrap.Table'
642 xtype : 'ColumnModel',
645 header : _this._strings['01abfc750a0c942167651c40d088531d'] /* # */,
647 renderer : function(v,x,r) {
648 //console.log(r.data.seqid);
649 //return String.format('{0}', v ? v : '');
652 String.format('{0}', r.data.seqid ? r.data.seqid : '')
653 +" <span style='color:lightgrey'>"
654 + String.format('{0}', r.data.id ? r.data.id : '')
664 xtype : 'ColumnModel',
667 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
669 renderer : function(v,x,r) {
670 return String.format('{0}', v ? v : '');
679 xtype : 'ColumnModel',
681 dataIndex : 'display_name',
682 header : _this._strings['b48968e1c912da07df5e8d6d246291ec'] /* Display Name */,
684 renderer : function(v,x,r) {
685 return String.format('{0}', v ? v : '');
694 xtype : 'ColumnModel',
696 dataIndex : 'active',
697 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
699 renderer : function(v,x,r) {
700 var state = v > 0 ? '-checked' : '';
702 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';