1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    99
    Vote Rating
    0
    Perdiga is an unknown quantity at this point

      0  

    Default dynamic carousel

    dynamic carousel


    how can i make one carousel dynamic? i am trying do do this

    Code:
    mySlideShowPanel.removeAll(true,false);
    for(i = 0 ; i < result.Result.length ; i++ ){
                            mySlideShowPanel.add([{
                                xtype: 'image',
                                cls: 'my-carousel-item-img',
                                id: 'image'+i,
                                src: result.Result[i].uri,
                                nome: result.Result[i].nome,
                                atual:i+1,
                                total:result.Result.length,
                            }])
                        }
    the first time works fine but not the second time

    Code:
    NOT_FOUND_ERR: DOM Exception 8: An attempt was made to reference a Node in a context where it does not exist.

  2. #2
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    The following code works fine for me:

    Code:
    Ext.setup({
        onReady: function() {
            c = Ext.Viewport.add({
                xtype: 'carousel'
            });
    
            c.add({
                html: 'one'
            });
    
            c.add({
                html: '2'
            });
    
            c.add({
                html: '3'
            });
        }
    });
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    99
    Vote Rating
    0
    Perdiga is an unknown quantity at this point

      0  

    Default


    the problem is when i need remove all items ..

  4. #4
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    That's a bug, but it is fixed in the next release:

    Code:
    Ext.setup({
        onReady: function() {
            c = Ext.Viewport.add({
                xtype: 'carousel'
            });
    
            c.add({
                html: 'one'
            });
    
            c.add({
                html: '2'
            });
    
            c.add({
                html: '3'
            });
    
            setTimeout(function() {
                c.removeAll(true, false);
    
                a = c.add({
                    html: 'a'
                });
    
                c.add({
                    html: 'b'
                });
    
                c.add({
                    html: 'c'
                });
    
                c.setActiveItem(a);
            }, 500);
        }
    });
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Thread Participants: 1