PDA

View Full Version : How to suspend change event of combobox in Ext Js 4.1.3?



nareh tank
25 Sep 2013, 10:44 PM
I bind change event of combobox in controller it's work but now I want to set some default value but I don't want to fire change event on this default value set.so I use combobox.suspendEvents() and combobox.resumeEvents() but it's not working..

I add some code below


combo.removeListener( 'change' );
combo.setValue(oldValue);
combo.addListener( 'change' );

Any suggestion for this?

ettavolt
27 Sep 2013, 12:21 PM
Are you using MVC approach? EventBus doesn't take in account suspending on target so you need to check it manually.

nareh tank
27 Sep 2013, 9:58 PM
Yes I am using MVC..I can't do it in view.Any alternate way to do this?

ettavolt
30 Sep 2013, 4:35 AM
In your listener you could check suspend status yourself. Like:


onComboChange:function(combo, newVal, oldVal) {
if(!combo.eventsSuspended) {
//Do what you want to do...