Check switch using ExtJS

Maybe something is missing for me, but how do I programmatically check the radio cassette using ExtJS (v 3)?

It 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 returns true, sometimes false

thanks

+4
source share
2 answers

Why not just use the DOM?

Ext.getDom('myradio').checked = true; 
+6
source

I 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); 
+11
source

Source: https://habr.com/ru/post/1398972/


All Articles