Formatting the SpinGadget

Share your advanced knowledge/code with the community.
MarkOtt
Posts: 14
Joined: Thu Sep 14, 2017 12:59 pm

Formatting the SpinGadget

Post by MarkOtt »

If displaying a year like 1963 in a SpinGadget it is formatted by default as 1.963 using a point as thousand separator what is not so nice for a year number.

The display of a SpinGadget can be formatted as follows by manipulating the "constraints" attributes:

Code: Select all

SpinGadget(#SpinGadgetYear, 70, 70, 100, 24, 1900, 9999, #PB_Spin_Numeric)

SpinGadgetId = GadgetID(#SpinGadgetYear)
! dijit.byId(v_spingadgetid.gadget.id).attr('constraints').places = 0;
! dijit.byId(v_spingadgetid.gadget.id).attr('constraints').pattern = '#';

; For values of "places" and "pattern" see at:
; https://dojotoolkit.org/reference-guide/1.7/quickstart/numbersDates.html
Best regards. Markus