notification not firing Show event.

4 posts, 1 answers
  1. Sapandeep
    Sapandeep avatar
    13 posts
    Member since:
    Jan 2012

    Posted 29 Nov 2016 Link to this post

    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,

     

     

  2. Answer
    Patrick
    Admin
    Patrick avatar
    204 posts

    Posted 30 Nov 2016 Link to this post

    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.
  3. Sapandeep
    Sapandeep avatar
    13 posts
    Member since:
    Jan 2012

    Posted 30 Nov 2016 in reply to Patrick Link to this post

    Thanks Patrick.
  4. Patrick
    Admin
    Patrick avatar
    204 posts

    Posted 30 Nov 2016 Link to this post

    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.
Back to Top