This issue duplicates another issue.
-
Sencha Premium Member
ComboBox suspendEvents doesn't work
Ext version tested:
Browser versions tested against:
Description:
- I am trying to suspend the events of a combobox, set a value in that combobox and resumeevents afterwards
Steps to reproduce the problem:
- Create a combobox
- Add an xtype selector listener in a controller
- 'mycombobox':{change:mychangefunction}
The result that was expected:
- that it wouldnt fire mychangefunction()
The result that occurs instead:
- it still fires mychangefunction()
Code:
I have an array of comboboxes that I obtained by using .query() on a panel. Then I iterate the through them and set a value in each.
Code:
console.info("silent", silent, typeof silent == "boolean")
if(optionsStore && views && viewSelectors){
for(var i = 0, l = viewSelectors.length; i < l; i++){
var viewRecord = optionsStore.findRecord("portal", views[i]);
if(silent){
viewSelectors[i].suspendEvents();
}
console.info("viewSelectors[i]", viewSelectors[i], viewSelectors[i].eventsSuspended);
viewSelectors[i].setValue(viewRecord);
console.info("viewSelectors[i]", viewSelectors[i], viewSelectors[i].eventsSuspended);
if(silent){
viewSelectors[i].resumeEvents();
}
}
}
console.info("silent", silent, typeof silent == "boolean")
The console with viewSelectors[i].eventsSuspended = 1
Set the change events of viewSelectors[i].setValue(viewRecord);
are still fired.
Thanks in advance
-
Sencha Premium User
I believe this might be a duplicate bug report, see this
-
Sencha Premium Member
looks like your right - thanks
-
Ext JS Premium Member
I found a solution for comboboxes. It doesn't fix it in the core, but at least you get your trigger to not fire.
Code:
mycombobox.suspendCheckChange++;
mycombobox.setValue(value);
mycombobox.suspendCheckChange--;
Christiaan Westerbeek @ Devotis
Contact me for help with Ext JS, Node JS, FireBase, AngularJS and Javascript in general.
Email me or find me at
AirPair to connect.