PDA

View Full Version : Setting the value of Radio button without triggering Change event



webfriend13
12 Nov 2012, 2:29 AM
HI All,

I have a radio button. When I use following code, system fires change event of the radio button.



Ext.getCmp('no-range-radio').setValue(true);


Is there is any way to suppress 'change' event when i set the value of the radio button using setValue?

tvanzoelen
12 Nov 2012, 2:38 AM
Suspend its events



var rf = Ext.getCmp('no-range-radio');
rf.suspendEvents();
rf.setValue(true);
rf.resumeEvents();

webfriend13
12 Nov 2012, 2:48 AM
Hi Tvanzoelen,

Thank you for quick reply. I was hoping if there is a straight forward (in-built) way to suppress the event rather then suspending the events. If not, I will use this :D.

tvanzoelen
12 Nov 2012, 2:53 AM
You could override the setValue function or take a look at the property checkChangeEvents.

You could set there only to listen for input events.

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Base