setProperties()
allows changing available configuration attributes of the control dynamically
setProperties(arg?: string | object, props?: object): void;
Parameters:
arg: string | object
- either the id of a radio button, or an object with the available attributes of the RadioGroup control and their new valuesprops: object
- optional, an object with the available attributes of the radio button and their new values
Example
// 1. Changes values in the configuration of the RadioGroup control
form.getItem("radiogroup").setProperties({
label: "New label",
labelPosition: "top",
helpMessage: " Help information",
options: {
rows: [
{
id: "first",
type: "radioButton",
text: "Select 1",
value: "1",
},
{
id: "second",
type: "radioButton",
text: "Select 2",
value: "2"
},
{
id: "third",
type: "radioButton",
text: "Select 3",
value: "3"
}
]
}
});
// 2. Changes values in the configuration of the specified radio button of the control
form.getItem("radiogroup").setProperties("first", {
text: "New Text",
padding: 20
});
We recommend that you apply the second way of using the method if you want to change the configuration of a separate radio button in the RadioGroup control:
form.getItem("radiogroup").setProperties("first", {
text: "New Text",
padding: 20
});
info
The method invokes the afterChangeProperties and beforeChangeProperties events.
It is possible to change values of the following configuration attributes of the RadioGroup 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 values of the following configuration attributes of a radio button of the RadioGroup 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