Results 1 to 6 of 6

Thread: Extjs6 activeItem config in Ext.tab.Panel

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-19895 in 6.5.1.345.
  1. #1
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    15

    Default Extjs6 activeItem config in Ext.tab.Panel

    Hello,

    i'm trying to use activeItem config in Ext.tab.Panel (modern toolkit) but it doesn't work. Am i misunderstanding something or is there a bug with this config ?

    Here is a fiddle ; https://fiddle.sencha.com/#fiddle/118j

    The expected result is the selection of the "Contact" tab.

    Hope someone can help.

    Kind regards.

  2. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    15

    Default

    I have a tabPanel with charts on the first tab and this bug slow down a lot the application when using setActiveItem instead of a config property before tabPanel instanciation. It is due to the load of the first tab even if it's not used.

    May i have an override to correct this issue please ?

    Thanks in advance for your help

  4. #4
    Ext JS Premium Member
    Join Date
    Dec 2010
    Location
    Orlando, FL
    Posts
    41

    Default

    The Sencha docs for activeItem say:

    Ext.Container
    activeItem : Object/String/Number
    The item from the items collection that will be active first. This is usually only meaningful in a card layout, where only one item can be active at a time. If passes a string, it will be assumed to be a Ext.ComponentQuery selector.
    Giving a child of the tab-panel an itemId (like childId), and then setting the activeItem config of the tab-panel to childId does not work.
    Calling
    Code:
    tabPanel.setActiveItem("#childId")
    also doesn't work.

  5. #5
    Sencha Premium User
    Join Date
    Mar 2017
    Posts
    21

    Lightbulb Try removing tabBar configuration

    I had the same issue and resolved it by removing tabBar config from the tabpanel

    Code:
    {
    xtype: 'tabpanel',
    tabBar: {
    cls: 'rounded'
    }, activeItem: 2, items:[{title: 'tab1', html: 'tab1'}, {title: 'tab2', html: 'tab2'}]
    }
    Now I'm looking for a workaround when using tabBar config...

  6. #6
    Sencha Premium User
    Join Date
    Mar 2017
    Posts
    21

    Default

    Quote Originally Posted by sentinelo View Post
    Now I'm looking for a workaround when using tabBar config...
    It seems that activeItem must be set BEFORE declaring tabBar config

    The activeItem works if I declare it just before tabBar

    Code:
    {
    	xtype: 'tabpanel',
    	activeItem: 2,
    	tabBar: {
    		cls: 'rounded'
    	},
    	items:[{title: 'tab1', html: 'tab1'}, {title: 'tab2', html: 'tab2'}]
    }

Similar Threads

  1. is config of activeItem no effect in navigationview?
    By zyt in forum Sencha Touch 2.x: Discussion
    Replies: 1
    Last Post: 11 Jul 2014, 3:47 AM
  2. [OPEN] Ext.tab.Panel activeItem config has display bug when using Toolbars
    By rmowder in forum Sencha Touch 2.x: Bugs
    Replies: 1
    Last Post: 24 Jul 2013, 4:12 AM
  3. activeItem not updating panel
    By bstras21 in forum Sencha Touch 2.x: Q&A
    Replies: 11
    Last Post: 18 Nov 2011, 2:11 PM
  4. [FIXED] Panel ignores activeItem config ...
    By keckeroo in forum Sencha Touch 2.x: Bugs
    Replies: 1
    Last Post: 31 Oct 2011, 11:12 AM
  5. [FIXED-40] 0.82 Ext.Carousel doesn't honor activeItem config
    By watrboy00 in forum Sencha Touch 1.x: Bugs
    Replies: 3
    Last Post: 27 Jul 2010, 3:38 PM

Posting Permissions

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