Results 1 to 4 of 4

Thread: [CLOSED] Tab's setCard method missing 2nd parameter for animation

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jun 2010

    Default [CLOSED] Tab's setCard method missing 2nd parameter for animation

    The setCard for the CardLayout class contains a second parameter for animation, but the Tab class's setCard method doesn't have that parameter.

  2. #2
    Sencha Premium User
    Join Date
    Mar 2007


    why would you want to animate switching between tabs?
    Founder of the Path of Exticism

  3. #3
    Sencha User
    Join Date
    Jun 2010

    Default Some issues

    Apparently I have confused TabPanel with TabBar... I thought that the item in a TabPanel was actually an Ext.Tab, however I see now that Ext.Tab's are the components in TabBars with a single associated card. I think naming the Tab's card change method setCard is confusing, as setCard is an implied method in any card layout component.

    I've got some issues though:

    Ext.TabBar's activeTab property is only set in onTabTap, not when the TabBar is constructed or you manually switch it by calling setActiveItem on a containing TabPanel

    Ext.TabBar's setCard method can only take a constructed object, not an implied one. If this will be the only available behavior, please ensure the method returns the TabBar so it will be chainable. If it will accept implied objects, then return the constructed object. Currently the method doesn't return anything.

    The setCard method of Ext.layout.CardLayout is not chainable because it doesn't return anything.

    The setActiveItem method of Ext.layout.CardLayout can return false or nothing at all (if cancelled from beforeactivate or beforedeactivate methods), and I am curious why it returns the activeItem instead of the container (it makes it unchainable, and the item parameter isn't parsed, it's either an item or the id of one).

    After calling setCard on a tab, if it is the active tab, the new data is not displayed. You need to switch back to another tab then go back to the changed one.

    These issues can be seen in the following code:
    Ext.setup({onReady: function () {
    var tabPanel = new Ext.TabPanel({ fullscreen: true, items: [
        { title: 'first', html: 'go to second tab' },
        { title: 'second', xtype: 'button', text: 'Click Me',
            handler: function () {
                //this one won't work
                //tabPanel.getTabBar().activeTab.setCard({ xtype: 'panel', html: 'second' });
                //this one works, but it's not chainable
                tabPanel.getTabBar().activeTab.setCard(new Ext.Panel({ html: 'second' }));
                //Attempt to switch off and back onto the changed tab, doesn't refresh the card
                //...also not chainable

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Haarlem, Netherlands


    Thanks for the constructive feedback meyerovb. We will definitely take your points into consideration.

Similar Threads

  1. Highlight Tab after setCard
    By qazs in forum Sencha Touch 1.x: Discussion
    Replies: 5
    Last Post: 6 Jan 2011, 10:47 PM
  2. Need help in navigating through panels and about SetCard method
    By titu in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 18 Jul 2010, 9:40 PM
  3. [CLOSED]Animation missing from Element.set* methods
    By orangechicken in forum Sencha Touch 1.x: Bugs
    Replies: 1
    Last Post: 2 Jul 2010, 11:15 PM
  4. [CLOSED] JavaDoc missing method Component.getModel()
    By EagleEye666666 in forum Ext GWT: Bugs (1.x)
    Replies: 2
    Last Post: 28 Jan 2009, 2:37 PM
  5. 2nd grid in the 2nd tab deformatted
    By tkm in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 8 Feb 2008, 9:48 AM

Posting Permissions

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