Spacer

This item takes space on the form and is used for aligning controls.

Adding Spacer

You can easily add a Spacer control during initialization of a form:

var form = new dhx.Form("form_container", {
    rows: [
        {
            type: "input",
            label: "Name",
            name: "name"
        },
        {
            type: "spacer",
            name: "spacer"
        },
        {
            type: "input",
            label: "Email",
            name: "email"
        }
    ]
});

Attributes

You can provide the following attributes in the configuration object of a Spacer:

Working with Spacer

You can manipulate a Spacer control by using methods (or events) of the object returned by the getItem() method.

For example, you can hide the control:

var value = form.getItem("spacer").hide();

List of the control methods:

getProperties returns an object with the available configuration attributes of the control
hide hides a Spacer control
isVisible checks whether a Spacer control is visible on the page
setProperties allows changing available configuration attributes of the control dynamically
show shows a Spacer control on the page

List of the control events:

afterChangeProperties fires after configuration attributes of the control have been changed dynamically
afterHide fires after a control is hidden
afterShow fires after a control is shown
beforeChangeProperties fires before configuration attributes of the control are changed dynamically
beforeHide fires before a control is hidden
beforeShow fires before a control is shown
Back to top