Results 1 to 8 of 8

Thread: Beta1: Carousel not removing items properly

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1773 in a recent build.
  1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    46
    Vote Rating
    1
      0  

    Default Beta1: Carousel not removing items properly

    Hi,

    I am having a dynamically *updated* carousel. The problem comes when I want to remove all the items and add other.
    If I use carousel.removeAll() I get this error: Uncaught Error: NOT_FOUND_ERR: DOM Exception 8

    it can be fixed in the following way:
    Code:
    for (var i=0; i<carousel.getItems().length;i++ )
                carousel.removeAt(1, true);
    carousel.add(items);
    carousel.setActiveItem(0);

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    This is working with no problems for me:

    Code:
    var carousel = new Ext.carousel.Carousel({
        fullscreen : true,
        items      : [
            {
                html : 'one'
            },
            {
                html : 'two'
            },
            {
                xtype  : 'toolbar',
                docked : 'top',
                items  : [
                    {
                        text    : 'Remove All',
                        handler : function() {
                            carousel.removeAll();
                        }
                    }
                ]
            }
        ]
    });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    46
    Vote Rating
    1
      0  

    Default

    Hi, I have the following:

    Code:
    Ext.define('Myapp.view.MyCarousel', {
        extend: 'Ext.Container',
        
        config: {
            layout: 'vbox',
            items: [
               {
                    itemId: 'id1',
                    xtype: 'carousel',
                    direction: 'horizontal',
                    directionLock: true,
                    flex: 1,
                    items: []
                },
                {
                    itemId: 'id2',
                    xtype: 'carousel',
                    direction: 'vertical',
                    directionLock: true,
                    flex: 3,
                    items: []
                }
            ]
        },
    });
    in the controller I have
    Code:
    ....
    myfunc: function ()
    {
                var items= [
                {
                    xtype: 'panel',
                    html: "text1"
                },
                {
                    xtype: 'panel',
                    html: "text2"
                }
            ];
            
            var carousel = Ext.getCmp('id2');
            
            console.log(carousel);
    
            carousel.removeAll();
    
    
            //for (var i=0; i<carousel.getItems().length;i++ )
           //     carousel.removeAt(1, true);
    
    
            carousel.add(items);
            
            carousel.setActiveItem(0);
    }
    ....

  4. #4
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    Thank you for the test case.

    Sencha Inc

    Jamie Avins

    @jamieavins

  5. #5
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    I can't reproduce your error given the test case in PR4, beta1, or the current head. One thing you might be running into is by not using removeAll you risk removing the indicator which you surely don't want to do.

    Sencha Inc

    Jamie Avins

    @jamieavins

  6. #6
    Sencha User
    Join Date
    Jun 2011
    Posts
    46
    Vote Rating
    1
      0  

    Default

    I believe, the indicator is destroyed indeed... Strange you can't reproduce it... This is part of an app of which the
    Myapp.view.MyCarousel
    container is *later* created as part of a layout: card Panel into the viewport after a user activity. So, may be the bug occurs in this particular case.

  7. #7
    Sencha User
    Join Date
    Dec 2011
    Posts
    9
    Vote Rating
    0
      0  

    Default

    I have the same problem, I can't make my dynamic carousel work in any way, I get the same DOM error. I can post snippets from my code but the problem is essentially the same one presented by the original poster.

  8. #8
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    Quote Originally Posted by maxgr View Post
    I have the same problem, I can't make my dynamic carousel work in any way, I get the same DOM error. I can post snippets from my code but the problem is essentially the same one presented by the original poster.
    If you can post a reproducible test case on a new thread, that would be great.

    Sencha Inc

    Jamie Avins

    @jamieavins

Posting Permissions

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