View Full Version : setBadge is not a function.

25 Mar 2011, 7:47 AM
I've googled my heart out and came to a few forum posts that seem to address this:

...except they don't for me.

I can access a panel directly and it's pulling the object:

var carousel = new Ext.Carousel({
badgeText: '16',
id: 'lookbook',
// 17 items

// edit the badge
console.debug(carousel.items.length); // 17
console.debug(carousel.badgeText); // 16

console.debug(Ext.getCmp('lookbook').badgeText); // 16
Ext.getCmp('lookbook').setBadge('20'); // function is undefined

// it's loaded in a panel with a var tabpanel
console.debug(tabpanel.items.items[1]); // carousel object
console.debug(tabpanel.items.items[1].badgeText); // 16
console.debug(tabpanel.items.items[1].badgeText = '20'); // 20
tabpanel.items.getAt(1).setBadge('6'); // undefined function
tabpanel.items.items[1].setBadge('7'); // undefined function
console.debug(tabpanel.items.items[1].badgeText); // 20, but stil shows onscreen as 16

Anyone have any insight? I'm using a modified demo that is the tab panels with the carousel being a tab. Everything else works, no other errors - just on setBadge('anything');

Thanks for any help!

25 Mar 2011, 7:50 AM
Well .

All the googling failures, scouring the results, and after I post, the answer is right below:


tabpanel.tabBar.items.getAt(1).setBadge('whatever'); // works!