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

Formatting the SpinGadget

by MarkOtt Fri Sep 22, 2017 10:06 am

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
Return to Tricks 'n' Tips

Who is online

Users browsing this forum: No registered users and 1 guest