This is a migrated thread and some comments may be shown as answers.

Overlapping notifications

1 Answer 144 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 23 Sep 2015, 11:20 AM

Hi,

 I need to be able to show some notifications that auto hide after 5 seconds and others that don't auto hide.  I am achieving this by using this code when I want to show a notification for 5 seconds:

 

01.var fadingnotification = $("#fadingnotification").kendoNotification({
02.    position: {
03.        pinned: true,
04.        bottom: 60,
05.        right: 30
06.    },
07.    stacking: "up",
08.    autoHideAfter: 5000,
09.    templates: [{
10.            type: "stickyinfonodismiss",
11.            template: $("#stickyInfoNoDismissTemplate").html()
12.        }, {
13.            type: "stickyinfo",
14.            template: $("#stickyInfoTemplate").html()
15.        }, {
16.            type: "info",
17.            template: $("#infoTemplate").html()
18.    }]
19.}).data("kendoNotification");
20. 
21.fadingnotification.show({
22.    message: msgToDisplay
23.}, "info");

and using the same code but with "autoHideAfter: 0" for the ones that I want to display without hiding.

 The problem I have is that this effectively initiates a new notification GUID each time so the notifications start again at the bottom of the screen each time even if there are already notifications on screen.

 Ideally I want to just change the autoHideAfter option without initialising a new notification and therefore a new GUID.

Any ideas?

Thanks,

Mark.

1 Answer, 1 is accepted

Sort by
0
Plamen Lazarov
Telerik team
answered on 25 Sep 2015, 11:53 AM

Hi Mark,

It is possible to use a single Notification widget instance and change the autoHideAfter setting on the fly. Please check the approach, which is described in the following documentation section:
 
http://docs.telerik.com/kendo-ui/web/notification/overview#change-settings-for-specific-notification-messages 

Regards,
Plamen Lazarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Notification
Asked by
Mark
Top achievements
Rank 1
Answers by
Plamen Lazarov
Telerik team
Share this question
or