PDA

View Full Version : Radio setChecked() method



Sov
15 Mar 2012, 10:30 AM
I'm relatively new to Sencha Touch and I've run into a bit of a problem trying to set up a listener for the Radio component label. What I want it to do is when I click on the label for the radio button, it would check the radio button for me, I have the code set up as follows...



new Ext.form.Radio({
id: 'moreImportant-' + this.radioGroup,
name: this.radioGroup,
value: '1',
label: '<span class="blue">More</span> Important',
cls: 'question_btn',
labelWidth: 125,
labelAlign: 'left',
listeners: {
labelEl: {
tap: function () {
var radioInput = Ext.getCmp('moreImportant-' + this.radioGroup);
console.log(radioInput);
radioInput.setChecked();
},
scope: this
}
}
})


I'm definitely finding the correct component when I check the console log but I'm unable to check the radio button using the setChecked() method. I'm I missing something?

mitchellsimoens
15 Mar 2012, 11:28 AM
Try


radioInput.setChecked(true);

Sov
15 Mar 2012, 11:40 AM
I tried this, but no luck. :(

mitchellsimoens
15 Mar 2012, 11:46 AM
Worked for me with 1.1.1

Sov
15 Mar 2012, 12:06 PM
Alright, it seems to be working now!