Web Notifications (Toastr)

(part of package 'Web Notifications')

You can access it in code via: plugins.webnotificationsToastr

Properties

API

clear

Removes current toasts using animation


clearToastr

Removes the toast with the given ID

Parameters:

toastrId object


createToastrOptions

Returns new, empty toastrOptions

@return {CustomType<webnotificationsToastr.toastrOptions>}

Returns: toastrOptions


error

Shows an error toastr with the given message, optional title and options

@param {String} message the message to show @param {String} title the optional title shown above the message @param {Object} options toastrOptions object with additional options @param {Object} toastrId optional id that can be used to clear this specific toastr via clearToastr @param {Function} onClick optional callback function when the toastr is clicked @example

plugins.webnotificationsToastr.error('Oh no. Something went wrong. It will be OK', 'Error', null, 'sampleID', onClickDialog);

function onClick(toastrId) {
	application.output('toastrId');
}

Parameters:

message string title string (optional) options toastrOptions (optional) toastrId object (optional) onClick function (optional)


info

Shows an info toastr with the given message, optional title and options

@param {String} message the message to show @param {String} title the optional title shown above the message @param {Object} options toastrOptions object with additional options @param {Object} toastrId optional id that can be used to clear this specific toastr via clearToastr @param {Function} onClick optional callback function when the toastr is clicked @example

plugins.webnotificationsToastr.info('Hey, Servoy World is coming up in May!', 'Servoy World', null, 'sampleID', onClickDialog);

function onClick(toastrId) {
	application.output('toastrId');
}

Parameters:

message string title string (optional) options toastrOptions (optional) toastrId object (optional) onClick function (optional)


setGlobalOptions

Sets the given options globally

@param {Object} options toastrOptions

Parameters:

options toastrOptions


success

Shows a success toastr with the given message, optional title and options

@param {String} message the message to show @param {String} title the optional title shown above the message @param {Object} options toastrOptions object with additional options @param {Object} toastrId optional id that can be used to clear this specific toastr via clearToastr @param {Function} onClick optional callback function when the toastr is clicked @example

plugins.webnotificationsToastr.success('Hey, Servoy World is coming up in May!', 'Servoy World', null, 'sampleID', onClickDialog);

function onClick(toastrId) {
	application.output('toastrId');
}

Parameters:

message string title string (optional) options toastrOptions (optional) toastrId object (optional) onClick function (optional)


warning

Shows a warning toastr with the given message, optional title and options

@param {String} message the message to show @param {String} title the optional title shown above the message @param {Object} options toastrOptions object with additional options @param {Object} toastrId optional id that can be used to clear this specific toastr via clearToastr @param {Function} onClick optional callback function when the toastr is clicked @example

plugins.webnotificationsToastr.warning('Hey, Servoy World is coming up in May!', 'Servoy World', null, 'sampleID', onClickDialog);

function onClick(toastrId) {
	application.output('toastrId');
}

Parameters:

message string title string (optional) options toastrOptions (optional) toastrId object (optional) onClick function (optional)


Types

toastrOptions

  • actionButton

    • If true will show a custom toastr with an additional action

    • Type: boolean

    • Default Value: "false"

  • actionButtonText

    • When the actionButton is true, set the text to show for the action section; can be an html string

    • Type: string

  • closeButton

  • closeHtml

  • disableTimeOut

  • enableHtml

  • extendedTimeOut

  • hideDuration

  • hideEasing

  • hideMethod

  • messageClass

  • newestOnTop

  • onActivateTick

  • positionClass

  • progressAnimation

  • progressBar

  • showDuration

  • showEasing

  • showMethod

  • tapToDismiss

  • timeOut

  • titleClass

  • toastClass


Last updated