Configuration

An object defining configuration options for the dxToast widget.

animation

An object defining animation options of the widget.

Type: Object

See the UI Widgets topic to learn how to configure animation options used to show and hide the widget.

Show Example:
jQuery

clickAction

An action performed when the widget is clicked.

Type: Action
Default Value: null

Show Example:
jQuery

closeOnOutsideClick

A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlaying window.

Type: Boolean
Default Value: false

displayTime

The time span in milliseconds during which the dxToast widget is visible.

Type: Number
Default Value: 2000

height

The height of the widget in pixels.

Type: Number|String|function
Default Value: function() { return $(window).height() * 0.8 }

The option can hold a value of the following types.

  • numeric - the height of the widget in pixels
  • string - a CSS measurement of the widget height (e.g., "55px", "80%", "auto" and "inherit")
  • function - a function returning the widget height (e.g., height:function(){ return baseHeight - 10 + "%"; })

hiddenAction

An action performed after the widget is hidden.

Type: Action
Default Value: null

Show Example:
jQuery

hiddingAction

An action performed before hiding the widget.

Type: Action
Default Value: null

Show Example:
jQuery

message

The dxToast message text.

Type: String
Default Value: ""

position

An object defining widget positioning options.

Type: Object

The postion option takes on an object containing the following fields: my, at, of and offset. Look at the following sentence to see how to use these fields to position the required element against the target element.

"Place my 'left' side at the 'left bottom' corner of the '#targetElement'." The bold quoted phrase located after each option name within the sentence represents a value of the appropriate option.

The offset field takes on a string containing horizontal and vertical offset values (in pixels) separated by space.

Show Example:
jQuery

shading

A Boolean value specifying whether or not to shade the screen beneath the overlay.

Type: Boolean
Default Value: false

Show Example:
jQuery

showingAction

An action performed before showing the overlay.

Type: Action
Default Value: null

Show Example:
jQuery

shownAction

An action performed after the widget is shown.

Type: Action
Default Value: null

Show Example:
jQuery

type

Specifies the dxToast widget type.

Type: String
Default Value: 'info'
Accepted Values: 'info'|'warning'|'error'|'success'|'custom'

The available toast types (except for "custom") only differ by the icon and background color.

If you assign "custom" to the type option, the dx-toast-custom class is applied to the widget element. Implement the appropriate CSS class to specify toast appearance.

Show Example:
jQuery

visible

A Boolean value specifying whether or not the widget is visible.

Type: Boolean
Default Value: false

You can show and hide the widget by changing the value of an observable variable passed to this option.

Show Example:
jQuery

width

The widget width in pixels.

Type: Number|String|function
Default Value: function() {return $(window).width() * 0.8 }

The option can hold a value of the following types.

  • numeric - the widget width in pixels
  • string - a CSS measurement of the widget width (e.g., "55px", "80%", "auto" and "inherit")
  • function - the function returning the widget width (e.g., width:function(){ return baseWidth - 10 + "%"; })