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

Removes the toast with the given ID

Parameters:


createToastrOptions()

Returns new, empty toastrOptions

Returns: toastrOptions


error(message,title,options,toastrId,onClick)

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

Example:

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

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

Parameters:

  • {string} message The message to show

  • {string} [title] The optional title shown above the message

  • {toastrOptions} [options] ToastrOptions object with additional options

  • {object} [toastrId] ToastrId optional id that can be used to clear this specific toastr via clearToastr

  • {function} [onClick] OnClick optional callback function when the toastr is clicked


info(message,title,options,toastrId,onClick)

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

Example:

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

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

Parameters:

  • {string} message The message to show

  • {string} [title] The optional title shown above the message

  • {toastrOptions} [options] ToastrOptions object with additional options

  • {object} [toastrId] ToastrId optional id that can be used to clear this specific toastr via clearToastr

  • {function} [onClick] OnClick optional callback function when the toastr is clicked


setGlobalOptions(options)

Sets the given options globally

Parameters:


success(message,title,options,toastrId,onClick)

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

Example:

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

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

Parameters:

  • {string} message The message to show

  • {string} [title] The optional title shown above the message

  • {toastrOptions} [options] ToastrOptions object with additional options

  • {object} [toastrId] ToastrId optional id that can be used to clear this specific toastr via clearToastr

  • {function} [onClick] OnClick optional callback function when the toastr is clicked


warning(message,title,options,toastrId,onClick)

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

Example:

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

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

Parameters:

  • {string} message The message to show

  • {string} [title] The optional title shown above the message

  • {toastrOptions} [options] ToastrOptions object with additional options

  • {object} [toastrId] ToastrId optional id that can be used to clear this specific toastr via clearToastr

  • {function} [onClick] OnClick optional callback function when the toastr is clicked


Types

toastrOptions

scripting type: CustomType<webnotificationsToastr.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