Field Relationships
Options

Options dependency

This dependency is used to dynamically load the list of dropdown options for a select field based on the value of another field. When the referenced field’s value changes, the target field’s dropdown options are reloaded (often via a configured API or data source).

Properties for options dependency

NameDescription
refIt is the reference name of the dependent field

Note: This dependency supports cascade behaviour which is ideal for multi-level dropdowns.

Example to load options

Example Schema

{
fields
:
[
0
:
{
name
:
"product_type"
meta
:
{
config
:
{
url
:
"/api/category"
labelKey
:
"name"
valueKey
:
"id"
}
displayName
:
"Product Type"
displayType
:
"select"
options
:
[
]
}
}
1
:
{
name
:
"brand_id"
meta
:
{
displayName
:
"Brand"
displayType
:
"select"
options
:
[
]
config
:
{
lazy
:
true
url
:
"/api/category/brands"
queryParams
:
[
]
labelKey
:
"name"
valueKey
:
"id"
}
dependencies
:
{
exists
:
{
}
options
:
{
}
}
}
}
2
:
{
name
:
"model_id"
meta
:
{
displayName
:
"Model"
displayType
:
"select"
options
:
[
]
config
:
{
lazy
:
true
url
:
"/api/category/models"
queryParams
:
[
]
labelKey
:
"name"
valueKey
:
"id"
}
dependencies
:
{
exists
:
{
}
options
:
{
}
}
}
}
]
}

Star us at github

© Copyright 2023 MuiForms