-
27 Apr 2012 11:26 AM #1
Ext.field.Toggle doesn't fire 'change' event when tapped
Ext.field.Toggle doesn't fire 'change' event when tapped
Sencha Touch 2.0.1-RC
Toggle element doesn't raise change event when tapped.
The code below doesn't raise change event in onComponentTap method.
Actually, change event is raised by Slider's onThumbDragEndCode:toggle: function() { var value = this.getValue(); this.setValue((value == 1) ? 0 : 1); return this; }, onComponentTap: function() { // Toggle the value, and return false so the normal slider functionality doesn't happen this.toggle(); return false; }
Code:onThumbDragEnd: function(thumb, e) { ..... this.fireEvent('dragend', this, thumb, this.getValue(), e); if (oldValue !== newValue) { this.fireEvent('change', this, thumb, newValue, oldValue); } },
-
27 Apr 2012 12:24 PM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
Thank you for the report.
-
27 Apr 2012 12:29 PM #3
Temporary workaround that works for me is:
Beware: It doesn't supply parameters to the event.Code:Ext.define('your.name.space', { override: 'Ext.field.Toggle', onComponentTap: function() { this.callParent(arguments); this.fireEvent('change'); return false; } });
I'v just place the code at the beginning of the view file.
-
1 May 2012 10:39 AM #4
Can't reproduce in 2.0.1 final. Please repost if it is still an issue for you.
Thanks!Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
1 May 2012 10:48 AM #5
I'm not planning to switch to 2.0.1 before release. But, I'v reviewed the source code and it seems, it should work well.
Thank you for your business!
-
1 May 2012 10:58 AM #6
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
1 May 2012 10:59 AM #7
Yes, I see. I mean our product release. Thanks.
-
18 Jun 2012 2:04 AM #8
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-2856
in
Sprint 22 (2.0.2).


Reply With Quote
