Edit this page

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.

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(getNotificationMessage());
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy