SuspendEvents on checkbox not working
I check the box programmatically,
since I am setting it dynamically, I want to pause (change the event) events on it because when I change the checkbox, I have other things to do.
I've already tried the following code, but it doesn't work.
checkbox.suspendEvents(false);
checkbox.setValue(true);
checkbox.resumeEvents();
thank
+3
source to share
5 answers
... setRawValue (true); the method will not fire a change event.
Seems like extjs bug a workaround is to set checkbox.lastValue = true;
along with setRawValue to detect the next change event.
+7
source to share
The suspendEvent is also available for the combobox. Here are the error reports:
- http://www.sencha.com/forum/showthread.php?171525-suspendEvents-did-not-affect-to-Ext.app.Controller.control
- http://www.sencha.com/forum/showthread.php?232919-ComboBox-suspendEvents-doesn-t-work
I found a solution that fixes it for comboboxes. Maybe the solution works for checkboxes too. It works in Ext JS 4.2.1. Perhaps other versions too.
checkbox.suspendCheckChange++;
checkbox.setValue(true);
checkbox.suspendCheckChange--;
+2
source to share