Results 1 to 2 of 2

Thread: Swap out images in a Carousel?

  1. #1
    Sencha User
    Join Date
    Sep 2007
    Location
    Phoenix AZ
    Posts
    121

    Default Swap out images in a Carousel?

    When using a Carousel if you want to completely change the images do you have to destroy the Carousel and create a new object or can you just change out the Images. I have not had any luck doing this as doing a remove on any image items on the carousel object throws an exception.

    Just calling carousel.remove(item);


    Code:
    Decorator.js?_dc=1574776392291:128 Uncaught TypeError: Cannot set property 'ownerCmp' of null
        at constructor.applyComponent (Decorator.js?_dc=1574776392291:128)
        at constructor.setter [as setComponent] (Config.js?_dc=1574776392288:324)
        at constructor.onItemRemove (Carousel.js?_dc=1574776392287:248)
        at constructor.doRemove (Container.js?_dc=1574776392287:998)
        at constructor.remove (Container.js?_dc=1574776392287:966)
        at ViewItem.js?_dc=1574776392287:85
        at Array.forEach (<anonymous>)
        at constructor.get (ViewItem.js?_dc=1574776392287:83)
        at constructor.react (Formula.js?_dc=1574776392289:370)
        at constructor.notify (Scheduler.js?_dc=1574776392289:424)
    Thanks.
    Mark

  2. #2
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    London, England
    Posts
    363

    Default

    Hi Mark,

    It looks like we have this as an open issue in our system (EXTJS-26818), and there is an override that can be used in the meantime to workaround the problem:

    Code:
    Ext.define('Overrides.Decorator', {
        override: 'Ext.Decorator',
    
        applyComponent: function(config) {
            var result = Ext.factory(config);
    
            if (result) {
                result.ownerCmp = this;
            }
    
            return result;
        }
    });
    Thanks,

    Dan
    Daniel Gallo
    Sales Engineer
    Sencha

Posting Permissions

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