Picture this: there's a listener set up for the native dijit/form/Select
element, ready to respond to the change
event:
nativeSelectWidget.on('change', lang.hitch(this, onSelectClick));
Now, I've developed my own custom widget that closely resembles Select and attempted to listen using the same code:
mySelectWidget.on('change', lang.hitch(this, onSelectClick));
The function onSelectClick
appears as follows:
_onTypeChange: function(value) {
console.debug('The value is, value)
}
The issue here is that in the second case, onSelectClick
isn't receiving any values (undefined
).
I attempted to include:
on.emit(this.domNode, 'change', {
bubbles: true,
cancelable: true
});
in the widget's _setValueAttr
, but it didn't work. No value was being passed through. I checked how the native Select
is defined here: https://github.com/dojo/dijit/blob/master/form/Select.js
Any recommendations?