Checkbox Group
This page provides instructions on using the Checkbox Group widget to allow users to select multiple items from a predefined set of choices.
Content properties
These properties are customizable options present in the property pane of the widget, allowing users to modify the widget according to their preferences.
Data
Options String
This property allows you to set the labels and values for the items. You can add these labels and values directly from the user interface or use JavaScript by providing options in JSON format, like:
[
{
"label": "Option1",
"value": "OPTION1"
},
{
"label": "Option2",
"value": "OPTION2"
}..
]
Ensure that the values assigned to each option are unique. Additionally, you can dynamically display data by using JavaScript. For instance, you can use the .map()
function to transform the data to the desired format, like:
{{getdata.data.map( p => ({label: p.country, value: p.country}))}}
Default Selected Values String
Allows you to set default options in a widget. These options are initially selected when the widget is loaded, representing the user's default input unless modified. Multiple default items can be added by providing them as an array of values. For example:
[
"OPTION1", "OPTION2"
]