Configuration

In this article you will find the detailed list of properties that you can use inside the constructors of message boxes and tooltip to adjust their configuration.

Message Box

Related sample:  Message. Show Message

The constructor of a message box may take the following parameters:


dhx.message({
    text:"Message text", 
    icon:"dxi-clock", 
    css:"expire", 
    expire:1000
});

Related sample:  Message. Message Configuration

Alert Box

Related sample:  Message. Show Alert

The constructor of an alert box may take the following parameters:


dhx.alert({
    header:"Alert Header",
    text:"Alert text",
    buttonsAlignment:"center"
});

Related sample:  Message. Alert And Confirm Configuration

Confirm Box

Related sample:  Message. Show Confirm

The constructor of a confirm box may take the following parameters:


dhx.confirm({
    header:"Confirm Header",
    text:"Confirm text",
    buttons:["cancel", "apply"],
    buttonsAlignment:"center"
});

Related sample:  Message. Alert And Confirm Configuration

Working with confirm

To find out which button was pressed, use the callback function that returns a Promise:

dhx.confirm({
    header: "confirm the action",
    text: "can you apply?",
    buttons: ["cancel", "apply"]
}).then(function(answer){
    if (answer){
        console.log("confirmed")
    }
    else {
        console.log("cancelled")
    }
});

Tooltip

Related sample:  Message. Show Tooltip

The constructor of a tooltip may take the following parameters:


dhx.tooltip("Tooltip From Right", {
    node: "fourth", 
    position: "right"
});

Related sample:  Message. Tooltip Position

Related sample:  Message. Tooltip Delay Configuration

Smart positioning

If the target of the tooltip is placed close to some edge of the browser, the tooltip will be shown from the opposite side of the target.

In the image below the target is adjacent to the right side of screen. Its tooltip that has the position:"right" attribute in the config object appears from the left side of the target.

Smart positioning

Tooltip API

You can control the activity of the Tooltip via the pair of methods.

  • to switch the tooltip off, use the disableTooltip() method:
dhx.disableTooltip();
  • to switch the tooltip on again, apply the enableTooltip() method:
dhx.enableTooltip();
Back to top