# Class SimpleDoubleSpinnerConstraint

A simple double spinner constraint.

#### Deprecated

as of release 10.2.0. To handle double spinner constraints, please refer to SimpleNumberInputConstraint instead.

#### Hierarchy (view full)

- SimpleNumberInputConstraint
  - SimpleDoubleSpinnerConstraint

#####
Index

### Constructors

constructor

### Properties

$oid
serverValidate?
$oid

### Accessors

$class

### Methods

$init
$instanceof
$super
$supers
afterInit
get$Class
getFlags
getMax
getMin
proxy
reparseConstraint
setMax
setMin
validate
isAssignableFrom
isInstance

## Constructors

### constructor

- new SimpleDoubleSpinnerConstraint(a, b?, c?): SimpleDoubleSpinnerConstraint

- It can be String or number, the number or name of flag, such as "no positive", 0x0001.

  #### Parameters

  - ##### a: unknown

  - ##### `Optional` b: string | RegExp

    the regular expression

  - ##### `Optional` c: string

    the error message

  #### Returns SimpleDoubleSpinnerConstraint

  Inherited from SimpleNumberInputConstraint.constructor

## Properties

### $oid

$oid: number = 0

The object ID. Each object has its own unique $oid. It is mainly used for debugging purpose.

Trick: you can test if a JavaScript object is a ZK object by examining this property, such as `if (o.$oid) alert('o is a ZK object');`

Notice: zk.Class extends from zk.Object (so a class also has $oid)

Inherited from SimpleNumberInputConstraint.$oid

### `Optional` serverValidate

serverValidate?: boolean

Inherited from SimpleNumberInputConstraint.serverValidate

### `Static` $oid

$oid: any

Inherited from SimpleNumberInputConstraint.$oid

## Accessors

### $class

- get $class(): typeof ZKObject

- The class that this object belongs to.

  #### Returns typeof ZKObject

  Inherited from zul.inp.SimpleNumberInputConstraint.$class

## Methods

### $init

- $init(props?): void

- The constructor.

  #### Parameters

  - ##### `Optional` props: Record<string, unknown> | (() => void)

  #### Returns void

  #### Default Value

      it does nothing so the subclass needs not to copy back
      (also harmless to call back).

  #### See

  afterInit

  #### Deprecated

  as of 10.0 released. Using ES6 `constructor` instead.

  Inherited from SimpleNumberInputConstraint.$init

### $instanceof

- $instanceof(...klass): boolean

- Determines if this object is an instance of the class represented by the specified Class parameter. Example:

      if (obj.$instanceof(zul.wgt.Label, zul.wgt.Image)) {
      }

  #### Parameters

  - ##### `Rest` ...klass: any[]

    the Class object to be checked. Any number of arguments can be specified.

  #### Returns boolean

  true if this object is an instance of the class

  Inherited from SimpleNumberInputConstraint.$instanceof

### $super

- $super<M, F>(mtd, ...args): ReturnType<F>

- Invokes a method defined in the superclass with any number of arguments. It is like Function's call() that takes any number of arguments.

  Example: ```ts multiply: function (n) { return this.$super('multiply', n + 2); } ```

  #### Type Parameters

  - #### M extends "$init" | "$supers" | "_$ais" | "_$supers" | "_$proxies" | "_$super" | "_importantEvts" | "afterCreated_" | "afterInit" | "$class" | "get$Class" | "$oid" | "$instanceof" | "$super" | "proxy" | "validate" | "_cst" | "_errmsg" | "_init" | "_finishParseCst" | "_regex" | "_flags" | "_pos" | "serverValidate" | "_cstArr" | "getFlags" | "parseConstraint_" | "_cvtNum" | "_msgNumDenied" | "_msgDateDenied" | "_extractCst" | "reparseConstraint" | "_min" | "_max" | "getMin" | "setMin" | "getMax" | "setMax"

  - #### F extends any

  #### Parameters

  - ##### mtd: M

    the method name to invoke

  - ##### `Rest` ...args: Parameters<F>

    any number of arguments

  #### Returns ReturnType<F>

  the object being returned by the method of the superclass.

  #### See

  zk.Object.$supers

  Inherited from SimpleNumberInputConstraint.$super

- $super<M, F>(klass, mtd, ...args): ReturnType<F>

- Invokes a method defined in the superclass with any number of arguments. It is like Function's call() that takes any number of arguments.

  It is similar to ZKObject.$super, but this method works even if the superclass calls back the same member method. In short, it is tedious but safer.

  Example: ```ts foo.MyClass = zk.$extends(foo.MySuper, { multiply: function (n) { return this.$super(foo.MyClass, 'multiply', n + 2); } ```

  Notice that the class specified in the first argument is not the super class having the method. Rather, it is the class that invokes this method.

  #### Type Parameters

  - #### M extends "$init" | "$supers" | "_$ais" | "_$supers" | "_$proxies" | "_$super" | "_importantEvts" | "afterCreated_" | "afterInit" | "$class" | "get$Class" | "$oid" | "$instanceof" | "$super" | "proxy" | "validate" | "_cst" | "_errmsg" | "_init" | "_finishParseCst" | "_regex" | "_flags" | "_pos" | "serverValidate" | "_cstArr" | "getFlags" | "parseConstraint_" | "_cvtNum" | "_msgNumDenied" | "_msgDateDenied" | "_extractCst" | "reparseConstraint" | "_min" | "_max" | "getMin" | "setMin" | "getMax" | "setMax"

  - #### F extends any

  #### Parameters

  - ##### klass: typeof ZKObject

    the class that invokes this method.

  - ##### mtd: M

    the method name to invoke

  - ##### `Rest` ...args: Parameters<F>

    any number of arguments

  #### Returns ReturnType<F>

  the object being returned by the method of the superclass.

  #### See

  zk.Object.$supers

  #### Since

  5.0.2

  Inherited from SimpleNumberInputConstraint.$super

### $supers

- $supers<M, F>(name, args): ReturnType<F>

- Invokes a method defined in the superclass with an array of arguments. It is like Function's apply() that takes an array of arguments.

  Example: ```ts multiply: function () { return this.$supers('multiply', arguments); } ```

  #### Type Parameters

  - #### M extends "$init" | "$supers" | "_$ais" | "_$supers" | "_$proxies" | "_$super" | "_importantEvts" | "afterCreated_" | "afterInit" | "$class" | "get$Class" | "$oid" | "$instanceof" | "$super" | "proxy" | "validate" | "_cst" | "_errmsg" | "_init" | "_finishParseCst" | "_regex" | "_flags" | "_pos" | "serverValidate" | "_cstArr" | "getFlags" | "parseConstraint_" | "_cvtNum" | "_msgNumDenied" | "_msgDateDenied" | "_extractCst" | "reparseConstraint" | "_min" | "_max" | "getMin" | "setMin" | "getMax" | "setMax"

  - #### F extends any

  #### Parameters

  - ##### name: M

    the method name to invoke

  - ##### args: Parameters<F>

    an array of arguments. In most case, you just pass `arguments` (the built-in variable).

  #### Returns ReturnType<F>

  the object being returned by the method of the superclass.

  #### See

  zk.Object.$super

  Inherited from SimpleNumberInputConstraint.$supers

- $supers<M, F>(klass, name, args): ReturnType<F>

- Invokes a method defined in the superclass with an array of arguments. It is like Function's apply() that takes an array of arguments.

  It is similar to zk.Object.$supers, but this method works even if the superclass calls back the same member method. In short, it is tedious but safer.

  Example: ```ts foo.MyClass = zk.$extends(foo.MySuper, { multiply: function () { return this.$supers(foo.MyClass, 'multiply', arguments); } ```

  Notice that the class specified in the first argument is not the super class having the method. Rather, it is the class that invokes this method.

  #### Type Parameters

  - #### M extends "$init" | "$supers" | "_$ais" | "_$supers" | "_$proxies" | "_$super" | "_importantEvts" | "afterCreated_" | "afterInit" | "$class" | "get$Class" | "$oid" | "$instanceof" | "$super" | "proxy" | "validate" | "_cst" | "_errmsg" | "_init" | "_finishParseCst" | "_regex" | "_flags" | "_pos" | "serverValidate" | "_cstArr" | "getFlags" | "parseConstraint_" | "_cvtNum" | "_msgNumDenied" | "_msgDateDenied" | "_extractCst" | "reparseConstraint" | "_min" | "_max" | "getMin" | "setMin" | "getMax" | "setMax"

  - #### F extends any

  #### Parameters

  - ##### klass: typeof ZKObject

    the class that invokes this method.

  - ##### name: M

    the method name to invoke

  - ##### args: Parameters<F>

    an array of arguments. In most case, you just pass `arguments` (the built-in variable).

  #### Returns ReturnType<F>

  the object being returned by the method of the superclass.

  #### See

  zk.Object.$super

  #### Since

  5.0.2

  Inherited from SimpleNumberInputConstraint.$supers

### afterInit

- afterInit(func): void

- Specifies a function that shall be called after the object is initialized, i.e., after zk.Object.$init is called. This method can be called only during the execution of zk.Object.$init.

  It is an advance feature that is used to allow a base class to do something that needs to wait for all deriving classes have been initialized.

  Invocation Sequence:

  - The most derived class's $init (subclass)
  - The based class's $init (if the derived class's $init invokes this.$supers('$init', arguments))
  - The first function, if any, be added with afterInit, then the second (in the same order that afterInit was called)...

  #### Parameters

  - ##### func: CallableFunction

    the function to register for execution later

  #### Returns void

  #### See

  zk.Object.$init

  #### Deprecated

  as of 10.0 released. Using afterCreated_ instead.

  Inherited from SimpleNumberInputConstraint.afterInit

### get$Class

- get$Class<T>(): T

- #### Type Parameters

  - #### T extends typeof ZKObject

  #### Returns T

  the class of the subsclass which extends from zk.Class.

  #### Since

  10.0.0

  Inherited from SimpleNumberInputConstraint.get$Class

### getFlags

- getFlags(): Partial<Record<"NO_POSITIVE" | "NO_NEGATIVE" | "NO_ZERO" | "NO_EMPTY" | "NO_FUTURE" | "NO_PAST" | "NO_TODAY" | "STRICT" | "SERVER", boolean>>

- #### Returns Partial<Record<"NO_POSITIVE" | "NO_NEGATIVE" | "NO_ZERO" | "NO_EMPTY" | "NO_FUTURE" | "NO_PAST" | "NO_TODAY" | "STRICT" | "SERVER", boolean>>

  the constraint flags Object which has many attribute about constraint, For example, `f.NO_POSITIVE = true`.

  Inherited from SimpleNumberInputConstraint.getFlags

### getMax

- getMax(): undefined | number

- #### Returns undefined | number

  the maximum value.

  Inherited from SimpleNumberInputConstraint.getMax

### getMin

- getMin(): undefined | number

- #### Returns undefined | number

  the minimum value.

  Inherited from SimpleNumberInputConstraint.getMin

### proxy

- proxy<A, R>(func): ((...args) => R)

- Proxies a member function such that it can be called with this object in a context that this object is not available. It sounds a bit strange at beginning but useful when passing a member of an object that will be executed as a global function.

  Example: Let us say if you want a member function to be called periodically, you can do as follows. ```ts setInterval(wgt.proxy(wgt.doIt), 1000); //assume doIt is a member function of wgt ```

  With proxy, when doIt is called, this references to wgt. On the other hand, the following won't work since this doesn't reference to wgt, when doIt is called. ```ts setInterval(wgt.doIt, 1000); //WRONG! doIt will not be called with wgt ```

  Notice that this method caches the result so that it will return the same proxied function, if you pass the same function again.

  #### Type Parameters

  - #### A extends unknown[]

  - #### R

  #### Parameters

  - ##### func: ((...args) => R)

    a method member of this object

    - - (...args): R

      - #### Parameters

        - ##### `Rest` ...args: A

        #### Returns R

  #### Returns ((...args) => R)

  a function that can be called as a global function (that actually have `this` referencing to this object).

  - - (...args): R

    - #### Parameters

      - ##### `Rest` ...args: A

      #### Returns R

  Inherited from SimpleNumberInputConstraint.proxy

- proxy<A0, A, R>(func): ((arg0, ...args) => R)

- #### Type Parameters

  - #### A0

  - #### A extends unknown[]

  - #### R

  #### Parameters

  - ##### func: ((arg0, ...args) => R)

    - - (arg0, ...args): R

      - #### Parameters

        - ##### arg0: A0

        - ##### `Rest` ...args: A

        #### Returns R

  #### Returns ((arg0, ...args) => R)

  - - (arg0, ...args): R

    - #### Parameters

      - ##### arg0: A0

      - ##### `Rest` ...args: A

      #### Returns R

  Inherited from SimpleNumberInputConstraint.proxy

- proxy<A0, A1, A, R>(func): ((arg0, arg1, ...args) => R)

- #### Type Parameters

  - #### A0

  - #### A1

  - #### A extends unknown[]

  - #### R

  #### Parameters

  - ##### func: ((arg0, arg1, ...args) => R)

    - - (arg0, arg1, ...args): R

      - #### Parameters

        - ##### arg0: A0

        - ##### arg1: A1

        - ##### `Rest` ...args: A

        #### Returns R

  #### Returns ((arg0, arg1, ...args) => R)

  - - (arg0, arg1, ...args): R

    - #### Parameters

      - ##### arg0: A0

      - ##### arg1: A1

      - ##### `Rest` ...args: A

      #### Returns R

  Inherited from SimpleNumberInputConstraint.proxy

- proxy<A0, A1, A2, A, R>(func): ((arg0, arg1, arg2, ...args) => R)

- #### Type Parameters

  - #### A0

  - #### A1

  - #### A2

  - #### A extends unknown[]

  - #### R

  #### Parameters

  - ##### func: ((arg0, arg1, arg2, ...args) => R)

    - - (arg0, arg1, arg2, ...args): R

      - #### Parameters

        - ##### arg0: A0

        - ##### arg1: A1

        - ##### arg2: A2

        - ##### `Rest` ...args: A

        #### Returns R

  #### Returns ((arg0, arg1, arg2, ...args) => R)

  - - (arg0, arg1, arg2, ...args): R

    - #### Parameters

      - ##### arg0: A0

      - ##### arg1: A1

      - ##### arg2: A2

      - ##### `Rest` ...args: A

      #### Returns R

  Inherited from SimpleNumberInputConstraint.proxy

- proxy<A0, A1, A2, A3, A, R>(func): ((arg0, arg1, arg2, arg3, ...args) => R)

- #### Type Parameters

  - #### A0

  - #### A1

  - #### A2

  - #### A3

  - #### A extends unknown[]

  - #### R

  #### Parameters

  - ##### func: ((arg0, arg1, arg2, arg3, ...args) => R)

    - - (arg0, arg1, arg2, arg3, ...args): R

      - #### Parameters

        - ##### arg0: A0

        - ##### arg1: A1

        - ##### arg2: A2

        - ##### arg3: A3

        - ##### `Rest` ...args: A

        #### Returns R

  #### Returns ((arg0, arg1, arg2, arg3, ...args) => R)

  - - (arg0, arg1, arg2, arg3, ...args): R

    - #### Parameters

      - ##### arg0: A0

      - ##### arg1: A1

      - ##### arg2: A2

      - ##### arg3: A3

      - ##### `Rest` ...args: A

      #### Returns R

  Inherited from SimpleNumberInputConstraint.proxy

### reparseConstraint

- reparseConstraint(): void

- #### Returns void

  Inherited from SimpleNumberInputConstraint.reparseConstraint

### setMax

- setMax(max): this

- Set the maximum value.

  #### Parameters

  - ##### max: number

  #### Returns this

  Inherited from SimpleNumberInputConstraint.setMax

### setMin

- setMin(min): this

- Set the minimum value.

  #### Parameters

  - ##### min: number

  #### Returns this

  Inherited from SimpleNumberInputConstraint.setMin

### validate

- validate(wgt, val): undefined | string | SimpleConstraintErrorMessages

- validation for flag, validate date if val is date

  #### Parameters

  - ##### wgt: Widget<HTMLElement>

  - ##### val: unknown

    a String, a number, or a date, the number or name of flag, such as "no positive", 0x0001.

  #### Returns undefined | string | SimpleConstraintErrorMessages

  Inherited from SimpleNumberInputConstraint.validate

### `Static` isAssignableFrom

- isAssignableFrom(cls): boolean

- Determines if the class by this Class object is either the same as, or is a superclass of, the class represented by the specified Class parameter. Example:

      if (klass1.isAssignableFrom(klass2)) {
      }

  #### Parameters

  - ##### cls: typeof ZKObject

    the Class object to be checked, such as zk.Widget.

  #### Returns boolean

  true if assignable

  Inherited from SimpleNumberInputConstraint.isAssignableFrom

### `Static` isInstance

- isInstance<T>(this, o): o is InstanceType<T>

- Determines if the specified Object is assignment-compatible with this Class. This method is equivalent to [[zk.Object#$instanceof]. Example:

      if (klass.isInstance(obj)) {
      }

  #### Type Parameters

  - #### T extends typeof ZKObject

  #### Parameters

  - ##### this: T

  - ##### o: unknown

    the object to check

  #### Returns o is InstanceType<T>

  true if the object is an instance

  Inherited from SimpleNumberInputConstraint.isInstance