Results 1 to 6 of 6

Thread: CardSwitch event is not firing

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    53
    Vote Rating
    0
      0  

    Default CardSwitch event is not firing

    I am using below view and when I am clicking in tabpanel item cardswitch event is not firing.

    HTML Code:
    Ext.define('RA.view.InterestingMomentListPanel', {
        extend: 'Ext.Panel',
        xtype: 'interestingmomentlistpanel',
        requires: [
                   'Ext.Toolbar',                                                             
        ],
        config: {
            layout: 'vbox',
            modal: true,
            zIndex: 10,
            hideOnMaskTap: true,
            centered: true,
            width: 600,
            height: 400,
            hidden: true,
            scrollable : {
                direction : 'vertical'
            },
    
            items: [
                    {
                        xtype: 'toolbar',
                        maxHeight: '50px',
                        docked: 'top',
                        flex: '1',
                        title: 'Interesting Moments List',
                    }, 
                    {
                        xtype: 'tabpanel',
                        docked: 'top',
                        cover : false,
                        id:'tabpanelitem',                
                        layout: 'card',
                        items: [
                        {
                            title: 'List'
                          
                       },
                            
                        
                        {
                            title: 'Table'
                           
                           
                        }
                    ],
                    
    listeners: {
        cardswitch : function() {
          alert('cardswitch!');
        }
    }
                    },
                    {
                        xtype: 'toolbar',
                        docked: 'bottom',
                        layout: { type: 'hbox', pack: 'right' },
                        items: [
                                {
                                    xtype: 'button',
                                    id: 'closeinterestingmomentlistpanelbutton',
                                    html: 'Close',
                                    ui: 'action',
                                    align: 'right',
                                    iconCls: 'delete',
                                    iconMask: true,
                                }
                        ]
                    }
            ]
        }
    })
    What mistake I am doing here? No error is coming at console.

  2. #2
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395
    Vote Rating
    24
      0  

    Default

    There's no "cardswitch" event available for TabPanels.
    You should listen for the "activeitemchange" one.

    http://docs.sencha.com/touch/2-1/#!/...tiveitemchange
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    53
    Vote Rating
    0
      0  

    Default

    But I am using 2.0.1 and there is that event according to sencha document.

  4. #4
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395
    Vote Rating
    24
      0  

    Default

    Quote Originally Posted by sandeepmnit35 View Post
    But I am using 2.0.1 and there is that event according to sencha document.
    I don't see it. Could you please tell me where you found it?
    http://docs.sencha.com/touch/2-0/#!/api/Ext.tab.Panel

    Thanks
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


  5. #5
    Sencha User
    Join Date
    Oct 2012
    Posts
    53
    Vote Rating
    0
      0  

    Default

    I got it work now. Thanks for your help.

  6. #6
    Sencha User
    Join Date
    Dec 2014
    Posts
    25
    Vote Rating
    4
      0  

    Default

    Sorry to resurrect an old post, but how did you get around this exactly? I need to run code after the item change animation.

    In ST1 there were beforecardswitch and cardswitch listeners, is something similar not available in ST2? It baffles me that these listeners were removed, I'm currently resorting to using Ext.Function.defer, which is less than ideal. I've also tried the after event on the tabpanel's layout->animation config, but it doesn't fire.

    Any help would be appreciated!

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
  •