-
14 Feb 2012 4:54 PM #1
Answered: How do I use setPressedButtons?
Answered: How do I use setPressedButtons?
I'm working with a SegmentedButton and I need to be able to reset all buttons to pressed=false after they're pressed.
The reason for this is that I don't want a toggle button, but more of an action link kind of button... (press this, navigate to this view).
How do I use 'setPressedButtons' to achieve this? Or is there another/better way to go about doing what I need?
-
Best Answer Posted by rdougan
This should do it:
Code:segmentedButton.setPressedButtons([]);
-
14 Feb 2012 6:25 PM #2
This should do it:
Code:segmentedButton.setPressedButtons([]);
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
14 Feb 2012 6:42 PM #3
Thanks rdougan. I tried the following and got this error
PHP Code:toggle: function(container, button, pressed){
var buttonText = button.getText();
console.log('User: buttonPress ~ "' + buttonText + '"');
if(buttonText === 'videos'){
// todo: activate the videos view
}
if(buttonText === 'calendar'){
// todo: activate the calendar view
}
if(buttonText === 'sites'){
// todo: activate the sites view
}
// reset the button pressed to false.
button.setPressedButtons([]);
}
Uncaught TypeError: Object [object Object] has no method 'setPressedButtons'
-
14 Feb 2012 7:08 PM #4


Reply With Quote