Reputation: 34435
I may be missing something, but how do I programmatically check a radiobutton using ExtJS (v 3)?
The following doesn't seem to always work
var radio = Ext.get("myradiobutton");
radio.set("checked,"");
The radio is sometimes checked, sometimes not...
radio.is(":checked") sometimes return true, sometimes false
Thanks
Upvotes: 5
Views: 23021
Reputation: 2783
For me it worked using the getCmp
and setValue
functions.
Ext.getCmp('yourid').setValue(true);
Upvotes: 1
Reputation: 2604
I'd suggested using this function: http://docs.sencha.com/ext-js/3-4/#!/api/Ext.form.Radio-method-setValue
var radio = Ext.get("myradiobutton");
radio.setValue(true);
Upvotes: 13
Reputation: 30082
Why not just use the DOM?
Ext.getDom('myradio').checked = true;
Upvotes: 6