Remoto - VFS: numberWidget Class Reference
Remoto - VFS

The numberWidget is a form field for numerical input. More...

#include "remoto!stdlib:js/widgets/widgets/numberWidget.js"

Inheritance diagram for numberWidget:
widget

Public Member Functions

 numberWidget (d)
 This is usually called by the widgetFactory. More...
 
 activate ()
 
 bound (min, val, max)
 Ensure that a number is within a minumum or maximum range. More...
 
 createWidget ()
 
 deactivate ()
 
- Public Member Functions inherited from widget
 widget (d)
 widget contstructor More...
 
 activate ()
 Activate the widget, which will cause changes to propagate to the form, and therefore the submit() mechanism. More...
 
 applyOptions ()
 Apply option changes to an existing widget, like from a diff. More...
 
 arrowMessage (m)
 Create an arrowMessage and point its arrow at this widget's position on screen. More...
 
 createHTML ()
 Create the HTML representation of this object, including the label and form field. More...
 
 createLabel ()
 Create the label jQuery object. More...
 
 createWidget ()
 Create the widget jQuery object. More...
 
 deactivate ()
 Deactivate the widget, which will unbind input events from their callbacks. More...
 
 destroy ()
 Destroy this widget. More...
 
 disable ()
 Disable this widget. More...
 
 doChange ()
 Collect changes to the value of this widget and call this widget's _change method, if it exists, after a period of the user's uifreqency has expired. More...
 
 enable ()
 Enable this widget. More...
 
 sync ()
 Sync the visible value with the internal value. More...
 
 validate ()
 Validate the value of this widget using the _validator function. More...
 
setter immediateValue
 Set the value of this widget, and trigger the doChange method without waiting. More...
 
getter value
 Return the internal value of this widget, which may not be the same as what is displayed in the interface. More...
 
getter defaultValue
 Return the default value of this widget. More...
 
getter visibleWidget
 Return the visible jQuery object for this widget. More...
 
getter isDefault
 Return whether or not this widget's value is its default value. More...
 
getter nonDefaultValue
 Return the value of this widget, or return undefined if it contains the default value. More...
 
setter validator
 Set this widget's validator function. More...
 
setter error
 Set the error value of this widget. More...
 
setter activeUser
 Set the activeUser of this widget. More...
 
getter enabled
 Return true or false based on _enabled state. More...
 
getter hidden
 The hidden state of this widget. More...
 

Getters & Setters

getter value
 a getter DOCME More...
 
setter enabled
 a setter Enable or disable this widget More...
 

Detailed Description

The numberWidget is a form field for numerical input.

This widget works for float, int, currency, etc. Options include:

  • min - the minimum value allowed, defaults to 0
  • max - the maxumum value allowed, defaults to 100
  • step - the tick size for arrow keys or for a range slider, defaults to 1
  • round - the number of decimal places allowed and shown, defaults to null, or no rounding
  • slider - whether or not to show the range slider, defaults to true or on. A boolean false will hide it.
  • epsilon - the allowable tolerance for the number to be considered changed. This is for cases like 1/9 where an irrational value isn't well recorded in JSON

To use the field for currency, set:

  • round: 2
  • step: .01
  • min: will default to 0 if not present
  • max: will default to 100 if not present

Invalid values will not be submitted.

Constructor & Destructor Documentation

◆ numberWidget()

numberWidget (   d)

This is usually called by the widgetFactory.

Parameters
dthe widget definition object

Member Function Documentation

◆ activate()

activate ( )

DOCME

◆ bound()

bound (   min,
  val,
  max 
)

Ensure that a number is within a minumum or maximum range.

Parameters
minThe minimum value
valThe value
maxThe maximum value
Returns
The bounded value

This local function is only for the number widget. It is not a member of the numberWidget class.

◆ createWidget()

createWidget ( )
Returns

DOCME

◆ deactivate()

deactivate ( )

DOCME

◆ enabled()

setter enabled

a setter Enable or disable this widget

◆ value()

setter value

a getter DOCME

a setter DOCME


The documentation for this class was generated from the following file: