PDA

View Full Version : Problem listening 'tabchange' in Ext.LayoutDialog



franzisk
28 May 2007, 3:38 AM
Why this is not working for me?

if(!profileWindow){
$('PROFILE-DETAIL').innerHTML = '';
profileWindow = new Ext.LayoutDialog("PROFILE-BOX", {
modal:true,
width:'96%',
height:'98%',
shim: true,
shadow:true,
minWidth:300,
minHeight:300,
proxyDrag: false,
center: {
autoScroll:true,
tabPosition: 'top',
closeOnTab: true,
alwaysShowTabs: true
}
});
profileWindow.addKeyListener(27, profileWindow.hide, profileWindow);
profileWindow.addButton('Delete');
profileWindow.addButton('Block');
profileWindow.addButton('Email');
profileWindow.addButton('History');
profileWindow.addButton('Remove', function(){
alert('To remove: '+profileId);
});
profileWindow.addButton('Close', profileWindow.hide, profileWindow);

var layout = profileWindow.getLayout();
layout.beginUpdate();
layout.add('center', new Ext.ContentPanel('PROFILE-DETAIL', {
title: 'Profile Details',
autoScroll: true,
fitToFrame: true,
fitContainer: true
} ));
layout.add('center', new Ext.ContentPanel("PROFILE-PHOTOS", {
title: 'Profile Photos',
background:true,
fitToFrame: true,
autoScroll: true
}));
layout.add('center', new Ext.ContentPanel("PROFILE-ALBUM", {
title: 'Photo Album',
background:true,
fitToFrame: true,
autoScroll: true
}));
layout.endUpdate();
}
$('PROFLE-TITLE').innerHTML = title;
profileWindow.show();

Tabs = profileWindow.getTabs(); //Ext.TabPanel
// NOT even with the 'tabchange' event it works
Tabs.on('beforetabchange', function(tabPanel, object, newTab){
alert('Before changin...');
//var index = Tabs.items.indexOf(newTab);
});

Animal
28 May 2007, 7:27 AM
What's "not working"?

When you step through in Firebug, what does "Tabs" contain?