Thursday, August 8, 2013

jQuery check a checkbox without firing a change event

You should suspend events before set the value and resume events after this. For example:
myCheckBox.suspendEvents(false); // Stop all events. 
//Be careful with it. Dont forget resume events!
myCheckBox.setValue(!myCheckBox.getValue()); // invert value
myCheckBox.resumeEvents(); // resume events

No comments:

Post a Comment