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:

  • {Object} toastrId The unique identifier of the toast notification to be removed.


createToastrOptions()

Returns new, empty toastrOptions

Returns: CustomType<webnotificationsToastr.toastrOptions> A new, empty toastrOptions object for configuring toast notifications.


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:


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:


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:


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:


Types

toastrOptions

Options to configure the appearance and behavior of toastr notifications. 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

    • If true, a close button is displayed on the toast.

    • Type: boolean

  • closeHtml

    • The HTML for the close button.

    • Type: string

  • disableTimeOut

    • If true, disables the auto-hide timeout.

    • Type: boolean

  • enableHtml

    • If true, allows HTML content in the toast message.

    • Type: boolean

  • extendedTimeOut

    • The time in milliseconds for extended timeout on hover.

    • Type: int

  • hideDuration

    • The duration in milliseconds for the hide animation.

    • Type: int

  • hideEasing

    • The easing function to use when hiding the toast.

    • Type: string

  • hideMethod

    • The method used to hide the toast (deprecated for old jQuery implementations).

    • Type: string

  • messageClass

    • CSS class applied to the toast message.

    • Type: string

  • newestOnTop

    • If true, newer toasts appear on top of older ones.

    • Type: boolean

  • onActivateTick

    • If true, activates a tick animation when the toast is activated.

    • Type: boolean

  • positionClass

    • CSS class that determines the position of the toast notification.

    • Type: string

  • progressAnimation

    • The type of animation used for the progress bar.

    • Type: string

  • progressBar

    • If true, displays a progress bar within the toast.

    • Type: boolean

  • showDuration

    • The duration in milliseconds for the show animation.

    • Type: int

  • showEasing

    • The easing function to use when showing the toast.

    • Type: string

  • showMethod

    • The method used to show the toast (deprecated for old jQuery implementations).

    • Type: string

  • tapToDismiss

    • If true, clicking on the toast will dismiss it.

    • Type: boolean

  • timeOut

    • The time in milliseconds before the toast auto-hides.

    • Type: int

  • titleClass

    • CSS class applied to the toast title.

    • Type: string

  • toastClass

    • CSS class applied to the toast container.

    • Type: string


Last updated

Was this helpful?