this is closely related to this post:
Is there an onSelect event or equivalent for HTML <select>?
…but specifically for the Dojo ComboBox..(I am using Dojo w/ ArcGIS JSAPI).
I have three combo boxes, which populate the successors using queries triggered by the selections from the dropdown list. My problem is that if the second combobox selection remains the same, the query is not triggered. I have tried using onblur and several other events instead of onchange, and tried to reset the value of the selection in JS, but neither has worked. The value is reset but the combobox still acts as if the same value is there, so onchange does not work. I tried many of the methods in the link above, but none worked for me. As far as I can tell, my comboboxes do not generate any selectedIndex.
Any suggestions? Thanks, J
All three dijits
dijit/form/Select,dijit/form/FilteringSelectanddijit/form/ComboBoxsubclassdijit/_HasDropDownand that adds them a propertydropDown:What you want is to listen on this
dropDownwidget. The problem is that in the case ofComboBoxandFilteringSelectthis widgetdijit/form/_ComboBoxMenugets instantiated lazily, i.e. when you open popup for the first time. So you need to hook to opening dropDown in the first place and then addonClickevent listener to the dropDown:It’s a bit easier when working with
dijit/form/Select, becausedropDownexists and you can listen toonExecuteon its dropDowndijit/Menuimmediately:See all three in action at jsFiddle: http://jsfiddle.net/phusick/Hp5jr/