Options
All
  • Public
  • Public/Protected
  • All
Menu

The Options class provides a convenient method of specifying where Editor should get the list of options for a select, radio or checkbox field. This is normally from a table that is left joined to the main table being edited, and a list of the values available from the joined table is shown to the end user to let them select from.

Options instances are used with the Field.options method.

export

Hierarchy

  • SearchBuilderOptions

Index

Constructors

Methods

  • exec(field: Field, editor: Editor, http: any, fieldsIn: any, leftJoinIn: any): Promise<IOption[]>
  • Execution function for getting the SearchBuilder options

    Parameters

    • field: Field

      The field to retrieve data from

    • editor: Editor

      The editor instance

    • http: any

      The http sent to the server

    • fieldsIn: any

      All of the fields

    • leftJoinIn: any

      Info for a leftJoin if required

    Returns Promise<IOption[]>

  • leftJoin(table: string, field1: string | Function, operator: string, field2: string): SearchBuilderOptions
  • Set the method to use for a leftJoin condition if one is to be applied to the query to retrieve data from two tables

    Parameters

    • table: string

      the table for the join

    • field1: string | Function

      the first field

    • operator: string

      operator for the join

    • field2: string

      the second field

    Returns SearchBuilderOptions

  • Get the ORDER BY clause for the SQL.

    Returns string

    ORDER BY clause

  • Set the ORDER BY clause to use in the SQL. If this option is not provided the ordering will be based on the rendered output, either numerically or alphabetically based on the data returned by the renderer.

    Parameters

    • order: string

      ORDER BY statement

    Returns SearchBuilderOptions

    Self for chaining

  • Get the configured label renderer

    Returns IRenderer

    Self for chaining

  • Set the label renderer. The renderer can be used to combine multiple database columns into a single string that is shown as the label to the end user in the list of options.

    Parameters

    • fn: IRenderer

      Renderering function

    Returns SearchBuilderOptions

    Self for chaining

Generated using TypeDoc