Planned
Last Updated: 19 Sep 2021 15:20 by ADMIN
Scheduled for 3.0.0
Created by: Matthias
Comments: 2
Category: Notification
Type: Feature Request
16
I would like to have a method for the reference of the component which will allow me to close the notifications, for example - Close().
Unplanned
Last Updated: 01 May 2021 05:30 by Douglas
Created by: Douglas
Comments: 3
Category: Notification
Type: Feature Request
4

I have utilized the Notification component in a centralized portion of my mainlayout and created a service so that all notifications flow through control so I don't have to repeat a TelerikNotification  component on every content page.    It is working great except..  there is no API control over the notifications once they are created.

What I would like to do is have all the open notifications cleared in response to a location change event on the NavigationManager.  I can accomplish the event but cant clear the notifications.

 

Thx

---

ADMIN EDIT

Here is a workaround - hide the notification component so it disposes and hides all notification popups, then show it again so you can keep using it:

<TelerikButton OnClick="@AddNotifications">Add success, info, warning, error notification</TelerikButton>

<TelerikButton OnClick="@HideAllNotifications">Hide all notifications</TelerikButton>

@if (isNotificationRendered) 
{ 
    <TelerikNotification @ref="@NotificationReference" Class="MyTelerikNotification"></TelerikNotification>
}

@code {
    //hide all implementation
    bool isNotificationRendered { get; set; } = true;
    async Task HideAllNotifications()
    {
        isNotificationRendered = false;
        await InvokeAsync(StateHasChanged);
        await Task.Delay(20);
        isNotificationRendered = true;
    }
    //end


    public TelerikNotification NotificationReference { get; set; }

    public void AddNotifications()
    {
        // Success
        NotificationReference.Show(new NotificationModel()
        {
            ThemeColor = ThemeColors.Success,
            Text = "Success",
        });

        // Info
        NotificationReference.Show(new NotificationModel()
        {
            ThemeColor = ThemeColors.Info,
            Text = "Info",
        });

        // Warning
        NotificationReference.Show(new NotificationModel()
        {
            ThemeColor = ThemeColors.Warning,
            Text = "Warning",
        });

        // Error
        NotificationReference.Show(new NotificationModel()
        {
            ThemeColor = ThemeColors.Error,
            Text = "Error",
        });
    }
}

<style>
    .MyTelerikNotification .k-notification-container .k-notification-wrap {
        width: 300px;
        height: 50px;
        font-size: 1.5em;
        text-align: center;
        align-items: center;
    }
</style>

---

Unplanned
Last Updated: 06 Mar 2021 19:41 by ADMIN
Created by: Can
Comments: 0
Category: Notification
Type: Feature Request
3
There could be an event on the component that receives three fields in its event arguments - 1) bool whether it was closed manually or through a timer, 2) the Text (if originally provided) and 3) the model (if provided - you either pass text or a model).
Unplanned
Last Updated: 01 Mar 2021 10:30 by ADMIN
Created by: Garrett
Comments: 0
Category: Notification
Type: Feature Request
1

I would like to show a maximum number of notifications.

For instance, if I have a maximum of two notifications and I am currently showing two on screen and a third needs to be shown, the first notification is dismissed and the new notification is shown.

 

===================

ADMIN EDIT

Once implemented, the Close/Hide method of the Notification can also be used to achieve the described setup.

===================