Chained Select
Example
API Methods
setData
Sets the data in the particular array of objects.
- Method
- Usage
setData(data: RadioButtonData[]): void
a8forms.ChainedSelect("widgetId").setData(
[
{
id: 0,
label: "fruits",
children: [
{
id: 1,
label: "orange",
children: [],
value: "orange"
}
],
value: "fruits"
}
])
setLabel
Sets the label of the field.
- Method
- Usage
setLabel(label: string): void
// Sets the field's label to 'My Text'
a8forms.ChainedSelect("chainedselectId").setLabel('Select')
setPlaceholder
Sets the placeholder as a string that temporarily holds the place to the final data.
- Method
- Usage
setPlaceholder(placeholder: string): void
// Sets the placeholder as Email in a text field
a8forms.ChainedSelect("chainedselectId").setPlaceholder("Email")
setSize
Sets the size only using the parameters passed in.
- Method
- Usage
setSize(size: "small" | "medium" | "large"): void
//Sets the size to small
a8forms.ChainedSelect("chainedselectId").setSize("small")
//Sets the size to medium
a8forms.ChainedSelect("chainedselectId").setSize("medium")
//Sets the size to large
a8forms.ChainedSelect("chainedselectId").setSize("large")
setVisibility
Sets if elements of the given field is visible in this view.
- Method
- Usage
setVisibility(visible: boolean): void
// setting the visibility true makes the element to visible
a8forms.ChainedSelect("chainedselectId").setVisibility(true)
// setting the visibility false makes the element invisible
a8forms.ChainedSelect("chainedselectId").setVisibility(false)
setVisibilityCondition
Sets the hide condition
- Method
- Usage
setVisibilityCondition(condition: string): void
// Hides the string
a8forms.ChainedSelect("chainedselectId").setVisibilityCondition("1 == 1")