-
27 Oct 2011 1:04 AM #1
SegmentedButton Listener - Button Object undefined
SegmentedButton Listener - Button Object undefined
hi everyone,
i use the segmented-button example from the touch 2.0 documentation and noticed that the listener does not receive the button-object.
The console prints "User toggled the 'undefined' button: on".
Tested in Chrome & Safari on OSX.
With Touch 1.1.1 this example works without an error so i guess its a bug, or am i doing something wrong?
Code:var segmentedButton = new Ext.SegmentedButton({ allowMultiple: true, items: [ { text: 'Option 1' }, { text : 'Option 2', pressed: true }, { text: 'Option 3' } ], listeners: { toggle: function(container, button, pressed){ console.log("User toggled the '" + button.text + "' button: " + (pressed ? 'on' : 'off')); } } });
edit:
calling button._text works
-
31 Oct 2011 12:09 PM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
Sounds like a bug in the event params, we will look into it, thank you for the report.
-
30 Dec 2011 10:01 AM #3
Are there news about this bug?
I cant detect what button is tapped.
Thanks.
-
3 Jan 2012 9:35 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
Are you still having the issue with PR3?
-
5 Jan 2012 8:32 AM #5
-
5 Jan 2012 9:54 AM #6
Instead of button.text you should use button.getText() or button.initialConfig.text depending on what you require.
-
6 Jan 2012 12:14 AM #7
with button.getText () works perfectly!!
thanks.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-940
in
2.0.


Reply With Quote