setProperties

allows changing available configuration attributes of the control dynamically

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

Parameters

argstring|objecteither the id of a radio button, or an object with the available attributes of the RadioGroup control and their new values
propertiesobjectoptional, 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
});

Details

The method invokes the afterChangeProperties and beforeChangeProperties events.

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

It is possible to change values of the following configuration attributes of a radio button of the RadioGroup control:

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
});
Change log

added in v7.0

Back to top