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

notification not firing Show event.

3 Answers 111 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Sapandeep
Top achievements
Rank 1
Sapandeep asked on 29 Nov 2016, 09:50 PM

hi i am trying to use Notification . 

And i am following same steps as shown in Demo. i put following code in show Event . But event is either not firing or function is not being called. I want to call Show event to get the notification centered.

 

function onShow(e) {
     alert ("in loop");
   var element = e.element.parent(),
                            eWidth = element.width(),
                            eHeight = element.height(),
                            wWidth = $(window).width(),
                            wHeight = $(window).height(),
                            newTop, newLeft;
                        
                        newLeft = Math.floor(wWidth / 2 - eWidth / 2);
                        newTop = Math.floor(wHeight / 2 - eHeight / 2);

                        e.element.parent().css({top: newTop, left: newLeft});
}   

   var centered = $("#notification").kendoNotification({
                        stacking: "down",
                        show: onShow,
                        button: true
                    }).data("kendoNotification");

  var notification = $("#notification").kendoNotification().data("kendoNotification");
                        notification.show("Assessment Saved successfully");
  });
</scri

 

following is the Dojo link.

http://dojo.telerik.com/idEHE/5

 

Please help. 

 

thanks,

 

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Patrick | Senior Technical Support Engineer
Telerik team
answered on 30 Nov 2016, 03:32 PM
Hello Sapandeep,

After reviewing your code, the reference to your notification was off.  Here's how you can get the reference to the Kendo Notification:
var notification = $("#notification").data("kendoNotification");

Everything else appears to be working accordingly as you can see in this updated Kendo UI Dojo by Progress.

I hope this helps!

Regards,
Patrick
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
0
Sapandeep
Top achievements
Rank 1
answered on 30 Nov 2016, 05:19 PM
Thanks Patrick.
0
Patrick | Senior Technical Support Engineer
Telerik team
answered on 30 Nov 2016, 06:04 PM
Hello Sapandeep,

Glad to help, and that everything is working!

Regards,
Patrick
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Tags
Notification
Asked by
Sapandeep
Top achievements
Rank 1
Answers by
Patrick | Senior Technical Support Engineer
Telerik team
Sapandeep
Top achievements
Rank 1
Share this question
or