Skip to main content

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

You can configure a message box on its initialization:

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

Related sample: Message. Message Configuration

note

You will find the list of configuration properties the constructor of the message box may take in the related article.

Alert Box#

Related sample: Message. Show Alert

You can define the configuration of an alert box on its initialization:

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

Related sample: Message. Alert And Confirm Configuration

note

See the list of configuration properties the constructor of the alert box may take here.

Confirm Box#

Related sample: Message. Show Confirm

You can configure a confirm box on its initialization:

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

Related sample: Message. Alert And Confirm Configuration

note

You can find the list of configuration properties the constructor of the confirm box may take in the related article.

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

You can configure a tooltip on its initialization:

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

Related Samples:

note

See the list of configuration properties the constructor of the tooltip may take here.

Smart positioning#

note

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();