Ducky
01-28-2010, 11:14 AM
On my screen, if the user does not have authority to do what they are seeking to do, I grey out the screen and throw up a small window with an error message and an OK button and an X in the upper right corner. When the user clicks on the OK or the X, the window disappears but not the tab. I know that Valence sets up the tab. I saw in the Ext 3.0 API documentation that there is a Tab Panel close and a Tab Panel deactivate but I do not know the name of the Tab Panel. How can I close the tab as well?
var win = new Ext.Window({
title: 'Change Work Area',
iconCls:'application_view_detail',
closable:false,
resizable:false,
x:100,
y:150,
layout:'table',
bodyStyle: 'padding:20px',
height:100,
width:450,
items: [{
xtype: 'combo',
emptyText: 'Select the work area',
labelSeparator: ' ',
id: 'dArea',
triggerAction: 'all',
displayField: 'ARNAME',
valueField: 'ARAREA',
store: new Ext.data.JsonStore({
autoLoad: true,
url: 'vvcall.pgm',
baseParams: {
pgm: 'CHGAREA',
action: 'load'
},
root: 'MLPAREA',
fields: ['ARAREA', 'ARNAME'],
listeners: {
load: function(){
Ext.Ajax.request({
url: 'vvcall.pgm',
params: {
action: 'getdefault',
pgm: 'CHGAREA'
},
success: function(response){
var check = response.responseText;
if (check) {
var data = Ext.util.JSON.decode(response.responseText);
}
if (data.SUCCESS == '1') {
Ext.getCmp('dArea').setValue(data.ARAREA);
}
else {
Ext.Msg.alert('Error',data.MSG);
win.close();
}
var win = new Ext.Window({
title: 'Change Work Area',
iconCls:'application_view_detail',
closable:false,
resizable:false,
x:100,
y:150,
layout:'table',
bodyStyle: 'padding:20px',
height:100,
width:450,
items: [{
xtype: 'combo',
emptyText: 'Select the work area',
labelSeparator: ' ',
id: 'dArea',
triggerAction: 'all',
displayField: 'ARNAME',
valueField: 'ARAREA',
store: new Ext.data.JsonStore({
autoLoad: true,
url: 'vvcall.pgm',
baseParams: {
pgm: 'CHGAREA',
action: 'load'
},
root: 'MLPAREA',
fields: ['ARAREA', 'ARNAME'],
listeners: {
load: function(){
Ext.Ajax.request({
url: 'vvcall.pgm',
params: {
action: 'getdefault',
pgm: 'CHGAREA'
},
success: function(response){
var check = response.responseText;
if (check) {
var data = Ext.util.JSON.decode(response.responseText);
}
if (data.SUCCESS == '1') {
Ext.getCmp('dArea').setValue(data.ARAREA);
}
else {
Ext.Msg.alert('Error',data.MSG);
win.close();
}