-
5 Nov 2012 3:53 PM #1
activeitemchange event order different in view/controller
activeitemchange event order different in view/controller
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.1b1, 2,1rc2
Browser versions tested against:- Chrome 22.0.1229.94
DOCTYPE tested against:- html
Description:- When I set an activeitemchange listener on a carousel, if I set it from a controller, it fires before the activeItem is changed. But if I set it on the view itself, it fires after the activeItem is changed.
Steps to reproduce the problem:- Load the code below, and swipe to the left.
The result that was expected:- Both listeners log the same value to the console, to indicate that they both were called before or after the activeItem changed.
The result that occurs instead:- The controller's listener logs "false", and the view's listener logs "true".
Code:activeitemchange from controller: false activeitemchange from view: true
Test Case:
Code:Ext.define('Test.view.MyCarousel', { extend: 'Ext.carousel.Carousel', xtype: 'myCarousel', config: { fullscreen: true, items: [{ itemId: 'a', html: 'a' }, { itemId: 'b', html: 'b' }, { itemId: 'c', html: 'c' }], listeners: { activeitemchange: function(carousel, value, oldValue, eOpts) { console.log('activeitemchange from view:', value === carousel.getActiveItem()); } } } }); Ext.define('Test.controller.MyController', { extend: 'Ext.app.Controller', config: { control: { 'myCarousel': { activeitemchange: 'onCarouselChange' } } }, onCarouselChange: function(carousel, value, oldValue, eOpts) { console.log('activeitemchange from controller:', value === carousel.getActiveItem()); } }); Ext.application({ name: 'Test', controllers: ['MyController'], views: ['MyCarousel'], launch: function() { Ext.create('Test.view.MyCarousel'); } });
HELPFUL INFORMATION
Screenshot or Video:- N/A
See this URL for live test case: N/A
Debugging already done:- none
Possible fix:- not provided
Additional CSS used:- only default ext-all.css
Operating System:- Mac OS 10.8
-
6 Nov 2012 5:08 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
Thanks for the report! I have opened a bug in our bug tracker.
You found a bug! We've classified it as
TOUCH-3663
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote