Skip to main content

setProperties()

allows changing the available configuration attributes of the ToggleGroup or its separate options dynamically

setProperties(config: object, id?: string): void;

Parameters:

  • config: object - a configuration object with the available attributes and their new values
  • id: string - optional, the id of an option to apply the new configuration object to

Example

// 1. Changes values in the configuration of the ToggleGroup control
form.getItem("ToggleGroup").setProperties({
full: true,
width: 140,
options: {
rows: [
{
id: "first",
text: "S",
},
{
id: "second",
text: "M",
},
{
id: "third",
text: "L",
},
]
}
});

// 2. Changes values in the configuration of the specified toggle of a ToggleGroup
form.getItem("ToggleGroup").setProperties({
text: "On Text",
offText: "Off Text"
}, "first");
info

The method invokes the afterChangeProperties and beforeChangeProperties events.

It is possible to change the values of the following configuration attributes of the ToggleGroup control:

{
css: string,
full: boolean,
gap: number,
height: string | number|"content",
multiselection: boolean,
options: object[],
padding: string | number,
width: string|number|"content"
}

It is possible to change the values of the following configuration attributes of a toggle of the ToggleGroup control:

{
full: boolean,
icon: string,
offIcon: string,
offText: string,
text: string,
value: string | number
}

You will find the description of these properties here.