Results 1 to 8 of 8

Thread: Activate Listener fires twice

Hybrid View

Previous Post Previous Post   Next Post Next Post
    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Touch Premium Member
    Join Date
    Mar 2007
    Posts
    67
    Vote Rating
    0
      0  

    Default Activate Listener fires twice

    When you use setActiveItem on a Carousel to move to a specific card, the Activate event fires twice.

    Is there a workaround for this, and/or is this a known bug?

  2. #2
    Touch Premium Member
    Join Date
    Mar 2007
    Posts
    67
    Vote Rating
    0
      0  

    Default Test in example code

    You can see this in action. In the examples/carousel2 folder of 1.02, add/replace the following at line 52 of index.js

    Code:
    html: rec.get('content'),
    cls: 'card ' + rec.get('cls'),
    listeners: {
        activate: function(){
            console.log(rec.internalId);
        }
    }
    You can see in the console that when you swipe, the event only fires once, but when you use the buttons (which is setActiveItem) it fires twice.

    Thanks for any help!

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    60
    Vote Rating
    0
      0  

    Default

    I'm experiencing this also.

  4. #4
    Touch Premium Member
    Join Date
    Mar 2007
    Posts
    67
    Vote Rating
    0
      0  

    Default BUMP: Any response

    Is there some reason that this is being ignored by Sencha support?

    I would just like an answer as to whether there is a work-around, or if a fix will be coming in the future.

  5. #5
    Sencha User
    Join Date
    Apr 2011
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Has anyone had the answer?

  6. #6
    Ext JS Premium Member
    Join Date
    Feb 2009
    Posts
    16
    Vote Rating
    0
      0  

    Default

    I am also experiencing this. After looking into the Card Layout's setActiveItem() code, I decided I'd leave a proper fix up to the Sencha dev team

    Here is my workaround:

    Code:
    this.on('activate', function() {
        /*
         * The activate listener fires twice, so ignore it if it's
         * recently fired
         */
        if (me.ignoreActivate) {
            return;
        }
        me.ignoreActivate = true;
        ext.defer(function() {
            me.ignoreActivate = false;
        }, 1000);
    
        // put the rest of your activation code here
    });
    By the way, this thread is about the same issue: http://www.sencha.com/forum/showthre...ires-twice-why

Similar Threads

  1. Activate event fires twice - why?
    By Tiffany A in forum Sencha Touch 1.x: Discussion
    Replies: 11
    Last Post: 29 Jun 2016, 7:58 AM
  2. getCard not available from tab activate listener
    By meyerovb in forum Sencha Touch 1.x: Bugs
    Replies: 7
    Last Post: 30 Jun 2010, 11:31 AM
  3. Listener never fires ... help
    By wgpubs in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 12 Dec 2008, 3:03 AM
  4. Tabs activate listener - odd behavior
    By str2etboy in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 20 Jun 2008, 9:53 AM
  5. how to get tab panel title from activate listener
    By vik in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 29 May 2008, 9:58 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
  •