You found a bug! We've classified it as a bug in our system. We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Ext User
    Join Date
    Jun 2010
    Posts
    9
    Vote Rating
    0
    Mphasize is on a distinguished road

      0  

    Default [FIXED-110] Carousel indicator breaks down after changing carousel content.

    [FIXED-110] Carousel indicator breaks down after changing carousel content.


    Hello,
    I had a problem with the Carousel component after I removed all the items (removeAll(true)) and dynamically loaded new items into the Carousel, because the indicator index was still pointing to a card position which did not exist anymore.
    My Quick&Dirty Fix: Check if the indicator index exists, and if not switch to index 0. See code snippet below.

    (ext-touch.js)
    Code:
    Ext.Carousel.Indicator = Ext.extend(Ext.Component, {
        [...]
        onCardSwitch: function(carousel, card, index) {
            if(this.indicators[index]) {
                this.indicators[index].radioClass('x-carousel-indicator-active');
            } else {
                this.indicators[0].radioClass('x-carousel-indicator-active');
            }
        }
        [...]
    }
    Cheers!
    M

  2. #2
    Ext User
    Join Date
    Jun 2010
    Posts
    9
    Vote Rating
    0
    Mphasize is on a distinguished road

      0  

    Default


    Well, if there's no card in the carousel yet, my quick fix with index 0 will also cause trouble. Now I use the code without the default behaviour and just check if the index I want to switch to exists.

    This means, that I have to use setActiveItem() after loading new data into the Carousel in order to get a correct indicator display again.

  3. #3
    Sencha User xantus's Avatar
    Join Date
    Aug 2007
    Location
    Seattle, WA
    Posts
    135
    Vote Rating
    0
    xantus is on a distinguished road

      0  

    Default


    Thanks. I opened a ticket for this issue.
    Software Engineer
    http://xant.us/

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    8
    TommyMaintz will become famous soon enough

      0  

    Default


    In the refactor I did for the Carousel I fixed this issue.

    In order to achieve what you are trying to do I used the following code
    Code:
    carousel.removeAll(true);
    carousel.add(items);
    carousel.doLayout();
    carousel.setCard(0);
    Expect this to be available in the next release.

  5. #5
    Ext User
    Join Date
    Jul 2010
    Posts
    26
    Vote Rating
    0
    achapman is on a distinguished road

      0  

    Default


    Thanks guys. I ran into this issue after upgrading to .91 and the setCard() function fixed it for me.

  6. #6
    Ext User
    Join Date
    Jun 2010
    Posts
    9
    Vote Rating
    0
    Mphasize is on a distinguished road

      0  

    Default


    Hi again,

    I updated to .91 today too and had another issue with this function, so....

    Here's what I try to do: I want to update the Carousel items with an Ajax Call, and while I'm waiting for the callback to fire, I don't want the users to see the old content anymore. So I use .removeAll(true) when I begin the Ajax request, but I have .add(), .doLayout(), and .setCard(0) in the callback function.

    Now, after removeAll() somehow an onCardSwitch event with the index -1 is fired, which satisfies the Ext.number check, but reports an error on if( this.indicators[index] ).

    I fixed this by checking that the index is >= 0.

    In ext-touch.js it now looks like this:
    Code:
        onCardSwitch: function(card, old, index) {
            if (Ext.isNumber(index) && index >= 0 && this.indicators[index]) {
                this.indicators[index].radioClass('x-carousel-indicator-active');
            }
        }
    Still, I guess that the better solution would be to prevent the event from firing with an index of -1 in the first place.

    Greetz!
    M

  7. #7
    Sencha User xantus's Avatar
    Join Date
    Aug 2007
    Location
    Seattle, WA
    Posts
    135
    Vote Rating
    0
    xantus is on a distinguished road

      0  

    Default


    Thanks. Fixed. You can use an override to fix that until next release.
    Software Engineer
    http://xant.us/

Similar Threads

  1. [FIXED-20] Carousel getActiveItem + previous not working
    By rdougan in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 11 Jun 2010, 6:04 PM
  2. Carousel panel content shows when it shouldn't (0.82)
    By rdougan in forum Sencha Touch 1.x: Bugs
    Replies: 0
    Last Post: 9 Jun 2010, 1:59 PM
  3. [OPEN] [FIXED-19] Can't put a TabPanel inside a carousel
    By rdougan in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 3 Jun 2010, 1:54 AM
  4. [OPEN] [FIXED][3.0 Core] Carousel itemSelector
    By Condor in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 4 Aug 2009, 12:50 PM
  5. [FIXED][3.0.0 Core] Ext.ux.Carousel
    By steffenk in forum Ext 3.x: Bugs
    Replies: 4
    Last Post: 4 Aug 2009, 12:04 PM

Thread Participants: 3

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar