ManyRelatedViewModelField

Source
import { ManyRelatedViewModelField } from "@prestojs/viewmodel";
ManyRelatedViewModelField<TargetViewModelT,SourceFieldNameT = string>

API

Constructor

new ManyRelatedViewModelField(props)
Params:
ParameterTypeDescription
*
props
An object with the properties below
props.asyncChoicesAsyncChoicesInterface
props.blankboolean
props.blankAsNullboolean
props.cacheViewModelCache
props.choicesMap|[SingleValueT, string][]
props.defaultValuenull|InstanceType[]|
props.formatterPropsRecord
props.helpTextstring
props.labelstring
props.readOnlyboolean
*props.sourceFieldNameSourceFieldNameT
*props.to|TargetViewModelT
props.widgetPropsRecord
props.writeOnlyboolean

Methods

clone()
Returns:Field
format(value)
Params:
ParameterTypeDescription
*valueInstanceType[]
Returns:any
getFormatterProps()
Returns:{[fieldName: string]: any }
getWidgetProps()
Returns:{[fieldName: string]: any }
isEqual(value1,value2)
Params:
ParameterTypeDescription
*value1InstanceType[]
*value2InstanceType[]
Returns:boolean
normalize(value)
Params:
ParameterTypeDescription
*valueany
Returns:InstanceType[]
parse(value)
Params:
ParameterTypeDescription
*valuenull|mapped[]
Returns:null|InstanceType[]
resolveViewModel()
Returns:Promise
toJS(value)
Params:
ParameterTypeDescription
*valueInstanceType[]
Returns:Record
toString()
Returns:string

Properties

_isResolvingDeps

Source
boolean

blank

Source
boolean

blankAsNull

Source
boolean

boundRecord

Source
undefined|ViewModelInterface

choices

Source
Map

defaultValue

Source
undefined|null|RelatedViewModelValueType[]|Promise

formatterProps

Source
Record

helpText

Source
string

isBound

Source
boolean

label

Source
string

many

Source
boolean

name

Source
string

readOnly

Source
boolean

sourceField

Source
Field

sourceFieldName

Source
SourceFieldNameT
TargetViewModelT

value

Source
undefined|RelatedViewModelValueType[]

widgetProps

Source
Record

writeOnly

Source
boolean

Static Properties

fieldClassName

Source
string