1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    2
    Vote Rating
    0
    keif is on a distinguished road

      0  

    Default setBadge is not a function.

    setBadge is not a function.


    I've googled my heart out and came to a few forum posts that seem to address this:
    http://www.sencha.com/forum/showthre...ope-of-a-Panel
    http://www.sencha.com/forum/showthre...rty-of-a-panel
    http://www.sencha.com/forum/showthre...684-.setBadge()

    ...except they don't for me.

    I can access a panel directly and it's pulling the object:
    Code:
    var carousel = new Ext.Carousel({
    	badgeText: '16',
    	id: 'lookbook',
    	items:....
    // 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!

  2. #2
    Sencha User
    Join Date
    Mar 2011
    Posts
    2
    Vote Rating
    0
    keif is on a distinguished road

      0  

    Default


    Well .

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

    http://www.sencha.com/forum/showthre...to-a-tab-by-id

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

Similar Threads

  1. .setBadge()
    By Simonhayre in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 28 Mar 2011, 1:51 PM
  2. Replies: 0
    Last Post: 7 Feb 2011, 4:21 AM
  3. SetBadge / TabPanel - badge text aligned right
    By KennethRusso in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 30 Dec 2010, 4:07 PM
  4. setBadge() to a tab by id
    By stefx in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 31 Aug 2010, 12:12 AM
  5. Replies: 6
    Last Post: 23 Jun 2007, 5:00 AM

Tags for this Thread