Create a new Options instance, to be configured by the chaining API
Create Options instance with basic database options
Table name (.table())
Value column name (.value())
Label column name (.label())
Create Options instance with a function to create a list of options
Custom function (.fn())
Add extra options to the list, in addition to any obtained from the database
Label
Optionalvalue: stringValue
Get the current alwaysRefresh flag
Set the flag to indicate that the options should always be refreshed (i.e. on get, create, edit and delete) or only on the initial data load (false).
Flag to set the always refresh to
Get the list of options from the database based on the configuration
Database connection
Values to search for
List of found options
Get the objects for a set of values.
Database connection
IDs to get
array|bool List of options
Get the function (if set) to get the options
Set the function used to get the options, rather than using the built in DB configuration.
Function to use for the custom options function
Get the current enablement flag
Enable / disable the reading of these options
Flag to enable / disable the reading of these options
Get the list of field names to include in the option objects
Column names from value() and label() that should be included in the output object for
each option, in addition to the value and label.
The list of columns to include in the output
Get the column(s) to be used for the label
Label columns
Set the column(s) to be used for the label
Database column names
Self for chaining
Add a left join condition to the Options instance, allowing it to operate over multiple tables.
In this form the method will take a function as the second parameter which is a Knex callback function allowing a complex join expression to be built.
Table name to do a join onto
Self for chaining
Add a left join condition to the Options instance, allowing it to operate over multiple tables.
Table name to do a join onto
Field from the parent table to use as the join link
Join condition (=, '<`, etc)
Field from the child table to use as the join link
Self for chaining
Get the currently applied LIMIT
Limit
Set the LIMIT clause to limit the number of records returned
Limit
Self for chaining
Get the ORDER BY clause for the SQL.
ORDER BY clause
Set the ORDER BY clause to use in the SQL. If this option is true
(which it is by default) the ordering will be based on the rendered output,
either numerically or alphabetically based on the data returned by the
renderer. If false no ordering will be performed and whatever is returned
from the database will be used.
ORDER BY statement
Self for chaining
Do a search for data on the source.
Database connection
Search term
array|bool List of options
Get the current search only flag
Set the flag to indicate if the options should always be refreshed (i.e. on get, create and edit) or only on the initial data load (false).
Flag to set the search only option to
Get the table that the options will be gathered from.
Table name
Set the database table from which to gather the options for the list.
Table name
Self for chaining
Get the column name to use for the value in the options list.
Column name
Set the column name to use for the value in the options list. This would normally be the primary key for the table.
Column name
Self for chaining
Get the WHERE condition for this option set.
Knex WHERE condition
Set the method to use for a WHERE condition if one is to be applied to the query to get the options.
Knex WHERE condition
Self for chaining
The Options class provides a convenient method of specifying where Editor should get the list of options for a
select,radioorcheckboxfield. 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.Optionsinstances are used with the Field.options method.Options