BooleanField

Source
import { BooleanField } from "@prestojs/viewmodel";
Hierarchy
  • Field<boolean>
  • BooleanField

Examples

Default widget in a Form

Default formatter for BooleanField

API

Constructor

new BooleanField(?options)
Source

Arguments:

ArgumentTypeDescription
options
An object with the properties below
options.asyncChoicesAsyncChoicesInterface
options.blankboolean
options.blankAsNullboolean
options.choices|[SingleValueT, string][]
options.defaultValuenull|ValueT|
options.formatterPropsRecord
options.helpTextstring
options.labelstring
options.readOnlyboolean
options.widgetPropsRecord
options.writeOnlyboolean

Methods

clone()
Source
Returns:Field
contributeToClass(viewModel)
Source

Arguments:

ArgumentTypeDescription
*viewModelViewModelConstructor
Returns:void
format(value)
Source

Arguments:

ArgumentTypeDescription
*valueboolean
Returns:any
getFormatterProps()
Source
Returns:{[fieldName: string]: any }
getWidgetProps()
Source
Returns:{[fieldName: string]: any }
isEqual(?value1,?value2)
Source

Arguments:

ArgumentTypeDescription
value1boolean
value2boolean
Returns:boolean
normalize(value)
Source

Arguments:

ArgumentTypeDescription
*valueboolean
Returns:null|boolean
parse(value)
Source

Arguments:

ArgumentTypeDescription
*valueany
Returns:null|boolean
toJS(value)
Source

Arguments:

ArgumentTypeDescription
*valueboolean
Returns:null|string|number|Record
toString()
Source
Returns:string

Properties

blank

Source
boolean

blankAsNull

Source
boolean

boundRecord

Source
undefined|ViewModelInterface

choices

Source

defaultValue

Source
undefined|null|ValueT|Promise

formatterProps

Source
Record

helpText

Source
string

isBound

Source
boolean

label

Source
string

name

Source
string

readOnly

Source
boolean

value

Source
undefined|ValueT

widgetProps

Source
Record

writeOnly

Source
boolean

Static Properties

fieldClassName

Source
string