DHTMLX Docs & Samples Explorer

dhtmlxMessage

dhtmlxMessage is a helper that lets you create different text messages.

Included files:

  • To use dhtmlxMessage you need to include one js file: message.js

    <script type="text/javascript" src="../message.js"></script>

Attributes:

  • id - the instance's ID
  • text - the text of a message.
  • lifetime - the time after passing which a message disappears (in milliseconds).
  • type - css class for a message box.
    While creating css class, please, use 'important' keyword to ensure correct processing.

Properties:

  • dhtmlx.message.defPosition - ('top', 'bottom' and 'left') sets the position of a message on a screen. The default value - 'bottom'.

The helper can be used in 2 forms:

  1. Short form
    (contains just text of a message - implicit usage of the parameter 'text'. The other parameters take default values)
  2. Full form
    (contains several available parameters. Non-specified parameters take default values)

Full form

dhtmlx.message.defPosition="top";
dhtmlx.message({
		text:"An error has occured.<br /> Please, see the log file!",
		lifetime:1000,
		type:"error" // 'error' - css class
});

Short form

dhtmlx.message("Your data has been successfully saved!");

See a usage example here