datatables.net-editor-server
    Preparing search index...

    Class default

    Common validation options that can be specified for all validation methods.

    Hierarchy (View Summary)

    Index

    Constructors

    • Create validation options

      Parameters

      • options: { empty?: boolean; message?: string; optional?: boolean } = {}

        Options

      Returns default

    Methods

    • Set a function that will be executed to see if a validator should be applied or not.

      Parameters

      • fn: DependsOnFunc

        Callback function to check if the validator should apply

      Returns this

    • If the given field has a value, this validator will be applied.

      Parameters

      • field: string

        Field to check for a value

      Returns this

    • If the given field has one of the value's specified, this validator will be applied.

      Parameters

      • field: string

        Field to check for a value

      • value: any

        Value(s) to check for

      Returns this

    • Allow a field to be empty, i.e. a zero length string - '' (true - default) or require it to be non-zero length (false).

      Returns boolean

    • Set the empty option for this validator

      Parameters

      • set: boolean

        Value to set

      Returns this

    • Get the error message to be used on validation error

      Returns string

    • Set the error message

      Parameters

      • msg: string

        Currently set message

      Returns this

    • Require the field to be submitted (false) or not (true - default). When set to true the field does not need to be included in the list of parameters sent by the client - if set to false then it must be included. This option can be particularly useful in Editor as Editor will not set a value for fields which have not been submitted - giving the ability to submit just a partial list of options.

      Returns boolean

    • Set the optional option for this validator

      Parameters

      • set: boolean

        Value to set

      Returns this