Skip to main content

getProperties()

returns an object with the available configuration attributes of the control

getProperties(id?: string): object;

Parameters:

  • id: string - optional, the id of a checkbox

Returns:

An object either with the available attributes of the control and their values, or with the available attributes of the checkbox and their values

Example

const form = new dhx.Form("form_container", { 
rows: [
{
id: "checkboxGroup",
type: "checkboxGroup",
name: "checkboxGroup",
required: true,
label: "Checkbox Group",
labelWidth: 140,
labelPosition: "left",
helpMessage: "Help information",
padding: "50px",
value: {
first: true,
},
options: {
padding: "50px",
rows: [
{
id: "first",
type: "checkbox",
text: "Select 1",
},
{
id: "second",
type: "checkbox",
text: "Select 2",
checked: true
}
]
}
}
]
});

// return the object of the CheckboxGroup control
form.getItem("checkboxGroup").getProperties();

// return the object of a checkbox of the CheckboxGroup control
form.getItem("checkboxGroup").getProperties("second");

The returned object of the CheckboxGroup control looks like:

{
css: "",
errorMessage: "",
height: "content",
helpMessage: "Help information",
hiddenLabel: false,
label: "Checkbox Group",
labelPosition: "left",
labelWidth: 140,
options: {...},
padding: 0,
preMessage: "",
required: true,
successMessage: "",
width: "content"
}

The returned object of a checkbox of the CheckboxGroup control looks like:

{
height: "content",
padding: 0,
text: "Select 2",
width: "content"
}

You will find the description of all these properties here.

Change log:

added in v7.0