Skip to main content

getProperties()

returns an object with the available configuration attributes of the control

getProperties(id?: string): ICheckboxGroupProps | ICheckboxGroupItemProps;

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
}
]
}
}
]
});

form.getItem("checkboxGroup").getProperties();
// -> the returned object for the CheckboxGroup control:
{
errorMessage: "",
height: "content",
helpMessage: "Help information",
hiddenLabel: false,
label: "Checkbox Group",
labelPosition: "left",
labelWidth: 140,
options: {...},
padding: 0,
preMessage: "",
required: true,
successMessage: "",
width: "content"
}

form.getItem("checkboxGroup").getProperties("second");
// -> the returned object for the specified checkbox of the control:
{
height: "content",
padding: 0,
text: "Select 2",
width: "content"
}

The returned object of the CheckboxGroup control can contain the following configuration attributes:

options(object) an object with options of a CheckboxGroup
width(string|number|"content") the width of a control
height(string|number|"content") the height of a control
required(boolean) defines whether a control is required
padding(string|number) sets padding between a cell and a border of a CheckboxGroup control
label(string) specifies a label for a control
hiddenLabel(boolean) invisible label that will be used to identify the input on the server side
labelPosition(string) defines the position of a label: "left"|"top"
labelWidth(string|number) sets the width of the label of a control
helpMessage(string) adds a help message to a control
preMessage(string) a message that contains instructions for interacting with the control
successMessage(string) a message that appears in case of successful validation of the control value
errorMessage(string) a message that appears in case of error during validation of the control value

Checkbox properties‚Äč

text(string) the text label of a checkbox
width(string|number|"content") the width of a checkbox
height(string|number|"content") the height of a checkbox
padding(string|number) sets padding between a cell and a border of a checkbox

Change log:

added in v7.0