How to catch increment and decrement events for dijit.form.NumberSpinner?

Is there a way to catch the increment and decrement events for dijit.form.NumberSpinner when the user clicks the up or down arrow in this widget? I know the "_arrowPressed" event, but I do not want to use it for some reason. I use the onChange event, but this does not fire until you lose the focus of this widget.

+4
source share
1 answer

Set intermediateChanges:true to get onChange with every change (without losing focus):

 <div id="spinner1" data-dojo-type="dijit/form/NumberSpinner" data-dojo-props=" name: 'spinner1', smallDelta: 1, largeDelta: 10, constrains: {min: 0, max: 100, places: 0}, value: 10, intermediateChanges: true " ></div> 

See how this works on this jsFiddle: http://jsfiddle.net/phusick/HCx3w/

+6
source

Source: https://habr.com/ru/post/1432011/


All Articles