Skip to main content

setProperties()

allows changing the available configuration attributes of the control dynamically

setProperties(arg?: string | object, properties?: object): void;

Parameters:

  • arg: string | object - optional, either the id of a checkbox, or an object with the available attributes of the CheckboxGroup control and their new values
  • properties: object - optional, an object with the available attributes of the checkbox and their new values

Example

// 1. Changes values in the configuration of the CheckboxGroup control
form.getItem("checkboxGroup").setProperties({
label: "New label",
labelPosition: "left",
options: {
rows: [
{
id: "first",
type: "checkbox",
text: "New Select 1",
},
{
id: "second",
type: "checkbox",
text: "New Select 2",
},
{
id: "third",
type: "checkbox",
text: "New Select 3",
},
]
}
});

// 2. Changes values in the configuration of the specified checkbox of a CheckboxGroup
form.getItem("checkboxGroup").setProperties("first", {
text: "New Text",
padding: 20
});
info

The method invokes the afterChangeProperties and beforeChangeProperties events.

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

{
css: string,
errorMessage: string,
height: string | number|"content",
helpMessage: string,
hiddenLabel: boolean,
label: string,
labelPosition: string,
labelWidth: string | number,
options: object,
padding: string | number,
preMessage: string,
required: boolean,
successMessage: string,
width: string|number|"content"
}

It is possible to change the values of the following configuration attributes of a checkbox of the CheckboxGroup control:

{
css: string,
height: string | number | "content",
padding: string | number,
text: string,
width: string | number | "content"
}

You will find the description of these properties here.

Change log:

added in v7.0