1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    53
    Vote Rating
    0
    sandeepmnit35 is on a distinguished road

      0  

    Default CardSwitch event is not firing

    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
    Posts
    1,395
    Vote Rating
    23
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      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
    sandeepmnit35 is on a distinguished road

      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
    Posts
    1,395
    Vote Rating
    23
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      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
    sandeepmnit35 is on a distinguished road

      0  

    Default


    I got it work now. Thanks for your help.

  6. #6
    Sencha User
    Join Date
    Dec 2014
    Posts
    22
    Vote Rating
    1
    MattPedro is on a distinguished road

      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!