PDA

View Full Version : setClosable is not a function



syl_via38
19 Apr 2012, 4:40 AM
Hello,

I have a tabpanel. And I want to dynamically change the possibility for the user to set a tab closable or not. For that I use de method (in the 4.0 documentation) setClosable() but I already get an error : setClosable is not a function.

Any idea ?

Thanks in advance
Sylvia (France)

scottmartin
19 Apr 2012, 5:35 AM
See if this will work for you:



var tabs = Ext.create('Ext.tab.Panel', {
width: 400,
height: 400,
renderTo: document.body,
items: [{
title: 'Home',
html: 'Home',
itemId: 'home'
}, {
title: 'Users',
html: 'Users',
itemId: 'users'
}, {
title: 'Tickets',
html: 'Tickets',
itemId: 'tickets'
}]
});

var users = tabs.child('#users');
users.tab.setClosable(true);

setTimeout(function(){
users.tab.setClosable(false);
alert('you waited too long!');
}, 2000);


Regards,
Scott.

syl_via38
19 Apr 2012, 5:38 AM
Thanks. I will try soon !