Results 1 to 4 of 4

Thread: Error occuring while removing items from carousel component!!!

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    30
    Vote Rating
    0
      0  

    Question Error occuring while removing items from carousel component!!!

    Hi All,

    While removing all items from carousel component using the function removeAll(), and trying to add items using the function setItems(). That time I'm getting an error as follows,

    Uncaught TypeError: Cannot call method 'createChild' of null

    Code:
    articleCatWise = this.getArticleCategoryWiseStore();
            articleCatWise.removeAll();
            articleCatWise.clearFilter();
            articleCatWise.filter([{
                property: 'catId',
                value: iCatId
            }]);
    
            articleCatWise.load({
                scope   : this,
                callback: function(records, operation, success) {
                    
                    var arrArticleItems = new Array();
                    var carouselItems = new Array();
                    var carouselSubItems = new Array();
                    var iCnt = 0;
                    
                    //arrArticleItems.push({});
                    
                    //the operation object contains all of the details of the load operation
                    articleCatWise.each(function(rec){
                        
                        carouselSubItems = new Array(rec.get('articleid'),rec.get('articletitle'),rec.get('articledate'),rec.get('articleshortdesc'),rec.get('articleimg'));
                        carouselItems.push(carouselSubItems);
                        iCnt++;                    
                        
                    });
                    
                    var iarrLen = iCnt;
                    var iMLp = 1;
                    var iSubLp = 1;
                    iCnt = 0;
                    
                    if(iarrLen > 0){
                        
                        for(iLp = 0; iLp < iarrLen; iLp++){
                            
                            var articleItems1 = new Array();
                            var articleItems2 = new Array();
                            
                            if(iMLp == 1){
    
                                if(carouselItems[iLp] != undefined){
                                    articleItems1.push({
                                        html: '<div><div><img src="'+ carouselItems[iLp][4] +'" border="0" /></div><div>'+  carouselItems[iLp][2] +'<br/>'+  carouselItems[iLp][1] +'<br/>'+  carouselItems[iLp][3] +'</div></div>',
                                        flex: 1                                    
                                    });
                                }
                                
                                if(carouselItems[iLp+1] != undefined){
                                    articleItems2.push({
                                        html: '<div><div><img src="'+ carouselItems[iLp+1][4] +'" border="0" /></div><div>'+  carouselItems[iLp+1][2] +'<br/>'+  carouselItems[iLp+1][1] +'<br/>'+  carouselItems[iLp+1][3] +'</div></div>',
                                        flex: 1
                                    });
                                }
                                
                                if(carouselItems[iLp+2] != undefined){
                                    articleItems2.push({
                                        html: '<div><div><img src="'+ carouselItems[iLp+2][4] +'" border="0" /></div><div>'+  carouselItems[iLp+2][2] +'<br/>'+  carouselItems[iLp+2][1] +'<br/>'+  carouselItems[iLp+2][3] +'</div></div>',
                                        flex: 1
                                    });
                                }
                                
                                if(carouselItems[iLp+3] != undefined){
                                    articleItems2.push({
                                        html: '<div><div><img src="'+ carouselItems[iLp+3][4] +'" border="0" /></div><div>'+  carouselItems[iLp+3][2] +'<br/>'+  carouselItems[iLp+3][1] +'<br/>'+  carouselItems[iLp+3][3] +'</div></div>',
                                        flex: 1
                                    });
                                }
                                
                                arrArticleItems.push({
                                    xtype: 'container',
                                    layout: {
                                        type: 'hbox'
                                    },
                                    items: [
                                    {
                                        html: '<div><div style="border:1px solid red;"><img src="'+ carouselItems[iLp][4] +'" border="0" /></div><div>'+  carouselItems[iLp][2] +'<br/>'+  carouselItems[iLp][1] +'<br/>'+  carouselItems[iLp][3] +'</div></div>',
                                        flex: 1
                                    },
                                    {
                                        xtype: 'container',
                                        layout: {
                                            type: 'vbox'
                                        },
                                        items: articleItems2
                                    }
                                    ]
                                });
                                
                                iLp = iLp + 3;
                                
                            }
                            else{
    
                                //First Array
                                if(carouselItems[iLp] != undefined){
                                    articleItems1.push({
                                        html: '<div><div><img src="'+ carouselItems[iLp][4] +'" border="0" /></div><div>'+  carouselItems[iLp][2] +'<br/>'+  carouselItems[iLp][1] +'<br/>'+  carouselItems[iLp][3] +'</div></div>',
                                        flex: 1
                                    });
                                }
                                
                                if(carouselItems[iLp+1] != undefined){
                                    articleItems1.push({
                                        html: '<div><div><img src="'+ carouselItems[iLp+1][4] +'" border="0" /></div><div>'+  carouselItems[iLp+1][2] +'<br/>'+  carouselItems[iLp+1][1] +'<br/>'+  carouselItems[iLp+1][3] +'</div></div>',
                                        flex: 1
                                    });
                                }
                                
                                if(carouselItems[iLp+2] != undefined){
                                    articleItems1.push({
                                        html: '<div><div><img src="'+ carouselItems[iLp+2][4] +'" border="0" /></div><div>'+  carouselItems[iLp+2][2] +'<br/>'+  carouselItems[iLp+2][1] +'<br/>'+  carouselItems[iLp+2][3] +'</div></div>',
                                        flex: 1
                                    });
                                }
                                
                                
                                //Second Array
                                if(carouselItems[iLp+3] != undefined){
                                    articleItems2.push({
                                        html: '<div><div><img src="'+ carouselItems[iLp+3][4] +'" border="0" /></div><div>'+  carouselItems[iLp+3][2] +'<br/>'+  carouselItems[iLp+3][1] +'<br/>'+  carouselItems[iLp+3][3] +'</div></div>',
                                        flex: 1
                                    });
                                }
                                
                                if(carouselItems[iLp+4] != undefined){
                                    articleItems2.push({
                                        html: '<div><div><img src="'+ carouselItems[iLp+4][4] +'" border="0" /></div><div>'+  carouselItems[iLp+4][2] +'<br/>'+  carouselItems[iLp+4][1] +'<br/>'+  carouselItems[iLp+4][3] +'</div></div>',
                                        flex: 1
                                    });
                                }
                                
                                if(carouselItems[iLp+5] != undefined){
                                    articleItems2.push({
                                        html: '<div><div><img src="'+ carouselItems[iLp+5][4] +'" border="0" /></div><div>'+  carouselItems[iLp+5][2] +'<br/>'+  carouselItems[iLp+5][1] +'<br/>'+  carouselItems[iLp+5][3] +'</div></div>',
                                        flex: 1
                                    });
                                }
                                
    
                                arrArticleItems.push({
                                    
                                    xtype: 'container',
                                    layout: {
                                        type: 'hbox'
                                    },
                            
                                    items: [
                                    {
                                        xtype: 'container',
                                        layout: {
                                            type: 'vbox'
                                        },
                                        items: articleItems1
                                    },
                                    {
                                        xtype: 'container',
                                        layout: {
                                            type: 'vbox'
                                        },
                                        items: articleItems2
                                    }
                                    ]                                
                                    
                                });
                                
                                iLp = iLp + 5;
                            }
                            
                            iMLp++;
                        }
                        
                        this.getContentCarousel().removeAll();
                        this.getContentCarousel().setItems(arrArticleItems);
                        
                    }
                    
                }
            });
    I'm using sencha touch 2.0 pr2 version with MVC pattern.
    Please go through the code and let me know.

    Any help would be greatly appreciated...

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

    Default

    This is a bug and is known.
    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
    Dec 2011
    Posts
    14
    Vote Rating
    0
      0  

    Default

    Any idea when this bug wil be fixed?

    thanks!
    Pieter

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    23
    Vote Rating
    5
      0  

    Default bug status?

    I'm still seeing this bug in 2.0.1rc. Is there a way to monitor bugs? Bug tracker somewhere? If so, what's the bug #?

Tags for this Thread

Posting Permissions

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