PDA

View Full Version : [FIXED][3.0] TabPanel enableAutoScroll broken



mschwartz
17 Apr 2009, 8:23 AM
When a tab is added that requires the autoscroll arrows to be rendered to the tab display area at the top of a TabPanel with enableAutoScroll: true, I get this error:

this.pos is undefined at line 22720 of ext-all-debug.js

The code:


// private
createScrollers: function() {
this.pos.addClass('x-tab-scrolling-'+this.tabPosition);

mschwartz
17 Apr 2009, 8:39 AM
Workaround:



listeners: {
render: function() {
this.pos = this.tabPosition=='bottom' ? this.footer : this.header;
}
}

evant
12 May 2009, 4:15 AM
?? enableAutoScroll isn't a property on the tab panel, it's enableTabScroll.

Just to confirm, did you have the property name correct?

mschwartz
12 May 2009, 4:32 AM
Yeah, typo in my post.

evant
12 May 2009, 5:49 AM
Can't confirm this:



Ext.onReady(function(){
var tabs = new Ext.TabPanel({
width: 200,
height: 200,
enableTabScroll: true,
renderTo: document.body,
items: {
title: 'T1'
}
});
new Ext.Button({
renderTo: document.body,
text: 'Foo',
handler: function(){
tabs.add({
title: 'newtab'
});
}
});
});


createScrollers gets called by autoScrollTabs, which sets this.pos.

mschwartz
12 May 2009, 6:25 AM
Using your exact code with ext-3.0-rc1:

Click on "foo" button 4 times, firebug stops at line 22720 of ext-all-debug.js:


// private
createScrollers: function(0 {
this.pos.addClass('x-tab-scrolling-' + this.tabPosition);


this.pos is undefined

createScrollers()()
autoScrollTabs()()
delegateUpdates()()
onAdd()(Object initialConfig...)
&c

mschwartz
12 May 2009, 6:31 AM
You can mark this closed since it works for you. It will work for me when I get the changes to the code you guys have been making, perhaps RC2 fixed it.

evant
12 May 2009, 6:35 AM
Yeah, works ok for me, must be a bug in one of the RC's.