showText

Displays a plain-text notification.

This is a safer version of the show method that assumes that you want to encode any markup passed in as a message.

Parameters

data Object|String|Function

Required. The string content for the notification; or the object with the values for the variables inside the notification template; or the function, which returns the required string or an object.

data.closeButton Boоlean If set to false the Notification will not render the close button.
type String

The notification type. Built-in types include "info", "success", "warning" and "error". Custom types should match the types from the template configuration. If this argument is not supplied, then "info" is assumed.

Example - Use the showText method to display a string

<span id="notification"></span>
<script>
var notificationWidget = $("#notification").kendoNotification().data("kendoNotification");

notificationWidget.showText("foo text", "warning");
</script>

Example - Use the show method and return the message from a function

<span id="notification"></span>
<script>
function getNotificationMessage() {
    return "foo text";
}

var notificationWidget = $("#notification").kendoNotification().data("kendoNotification");

notificationWidget.showText({
    closeButton: false,
    content: "Welcome to the Application",
    type: "warning"
});
</script>

Example - Use the showText() method to show the initially hidden close button

<span id="notification"></span>
<script>
    let notificationWidget = $("#notification").kendoNotification({
        button: false,
    }).data("kendoNotification");

    notificationWidget.showText({
        closeButton: true, //show the close button
        content: "Welcome to the Application"
    },
    "warning");
</script>
In this article
showText
Not finding the help you need?
Contact Support