Skip to main content

beforeChangeProperties

fires before configuration attributes of the control are changed dynamically

beforeChangeProperties: (properties: object, id?: string) => boolean | void;

Parameters:

  • properties: object - an object with configuration attributes of the ToggleGroup or its separate options and their new values
  • id: string - optional, the id of an option of the ToggleGroup

Returns:

Return false to cancel the default action of the event; otherwise, true.

Example

form.getItem("toggleGroup").events.on("beforeChangeProperties", function(properties) {
console.log("beforeChangeProperties", properties);
return true;
});

The properties object of the ToggleGroup control looks like:

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

The properties object object of a toggle of the ToggleGroup control looks like:

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

You will find the description of all these properties here.