There are some situations when a user may wish to use a number spinner control to enter a number for a field, but they wish to control the increments that can be used with Up & Down arrows.
WebMaker is shipped with the dojo framework already included in each project, which allows a number of more rarely used controls to be attached to a field.
In order to add a Number Spinner control you will need to perform the following steps:
Note: If you require further details on the specific dojo control, or you wish to add further levels of customisation, please visit the following link:
http://dojotoolkit.org/reference-guide/dijit/form/NumberSpinner.html#dijit-form-numberspinner
WebMaker is shipped with the dojo framework already included in each project, which allows a number of more rarely used controls to be attached to a field.
In order to add a Number Spinner control you will need to perform the following steps:
- The first step is to visit the Field Details page of FormMaker and select the Page Details at the top of the left hand panel tree structure. Open up the Page Events section and add a new event. The values required are Event of onbeforeload , Action of Custom Script and then script text of dojo.require('dijit.form.NumberSpinner');
[/*][*] You will then need to have added a 'Text Box' field control. For this control open the Data Constraints section on the Field Details.
[/*][*] Within the Data Constraints you will need to define the Data Type as 'Number' to ensure it is only validated for Number/Integer values
[/*][*] You can optionally set the 'MinInclusive' and 'MaxInclusive' to restrict the range of values for the field e.g. to 20.
[/*][*] You will then need to add a Custom Attribute with a Name of dojoType and Value of dijit.form.NumberSpinner [/*][*] You can optionally add a Custom Attribute with a Name of smallDelta and a Value of a number e.g. 5. This will increment the value of the field by the value of the smallDelta. [/*]
Note: If you require further details on the specific dojo control, or you wish to add further levels of customisation, please visit the following link:
http://dojotoolkit.org/reference-guide/dijit/form/NumberSpinner.html#dijit-form-numberspinner
RE: How do I add a Dojo Number Spinner control?