Results 1 to 3 of 3

Thread: [PR3] Items of a tab panel do not fire 'show' when shown.

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1253 in a recent build.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    134
    Vote Rating
    1
      0  

    Default [PR3] Items of a tab panel do not fire 'show' when shown.

    In 1.1.1, I used tabpanel's beforecardchange to trigger when a tab was being selected.

    Now, it looks like there's no way to detect when a new tab is chosen in 2.0PR3.

    On the tabpanel...
    Code:
    listeners:{
            activeItemChange:function(){}
    }
    only seems to fire when setActiveItem is called directly, and not when a tab is selected.

    Unfortunately, 'show' is not fired on the items of the tabpanel, either, so it looks like there isn't a way to detect tab changes at all.

    'show' should probably fire events for tabpanel children, and activeItemchange should fire when a tab is changed by the user. Either of these will resolve my particular issue, but both seem to be issues.

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    Thank you for the report.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha User rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,159
    Vote Rating
    7
      0  

    Default

    Odd; this is working for me

    Code:
    Ext.setup({
        onReady: function() {
            Ext.Viewport.add({
                xtype: 'tabpanel',
                items: [
                    {
                        title: 'one',
                        html: 'one',
                        listeners: {
                            show: function() {
                                console.log('show one');
                            }
                        }
                    },
                    {
                        title: 'two',
                        html: 'two',
                        listeners: {
                            show: function() {
                                console.log('show two');
                            }
                        }
                    }
                ],
                listeners: {
                    activeitemchange: function() {
                        console.log('activeitemchange');
                    }
                }
            });
        }
    'show one' gets logged when you first load the page.
    'show two' and 'activeitemchange' gets logged when you switch tab, by tapping the second tab and by using setActiveItem.

    This is using PR3.

    Can you use the above code and check if it works for you?
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •