Disable link

4 posts, 0 answers
  1. Zdzislaw Ziental
    Zdzislaw Ziental avatar
    30 posts
    Member since:
    Mar 2018

    Posted 12 Jun 2019 Link to this post

    I'm working on a page that will load the entire data of the entire week (the 7 days).
    And when the user changes the week I'll load the data only for that week.

    But if the user clicks the link of the day (highlighted in red in the attached image), the "read" method is executed again.

    I would like to show the date, but disable the link.
    I did this with jquery, but when the user changes week, this is lost.

    Is there a way to do this?

     

     

  2. Petar
    Admin
    Petar avatar
    333 posts

    Posted 14 Jun 2019 Link to this post

    Hi Zdzislaw,

    Thank you for the provided screenshot. A possible approach for achieving the desired functionality is to disable the click event of the day fields in the Scheduler. This could be achieved with the following code: 
    $(".k-scheduler-header-wrap").find("span[class = 'k-link k-nav-day']").bind('click', function () {
      return false;
    });
    When the above code is executed on $(document).ready() event, it will disable the clicks on the day fields for the first page as you've mentioned that you've successfully implemented this functionality. 

    Then to apply the same logic on all other pages, we could use the navigate event and execute this code, when the event is triggered:
    navigate: function (e) {
      var sender = $(e.sender.wrapper);
      setTimeout(function () {
        sender.find("span[class = 'k-link k-nav-day']").bind(
          'click',
          function () {
            return false;
          });
      }, 0);
    },
    With the above, on every navigation, we will disable the clicks of the "day" fields on the current view. 

    The last fine-tuning we could apply is to set different mouse cursor type when the cursor is positioned over the text in the "day" field. With this CSS code:
    .k-link.k-nav-day {
      cursor: context-menu;
    }
    there will be no change in mouse's cursor on hovering over the text. 

    Here is a Dojo demonstrating the described above functionality. Please check it and let me know if it resolves your issue, or if you have questions regarding the implementation. 

    Regards,
    Petar
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Zdzislaw Ziental
    Zdzislaw Ziental avatar
    30 posts
    Member since:
    Mar 2018

    Posted 14 Jun 2019 in reply to Petar Link to this post

    Perfect, thank you.

     

  4. Petar
    Admin
    Petar avatar
    333 posts

    Posted 17 Jun 2019 Link to this post

    Hi Zdzislaw,

    I am happy the proposed solution resolved the issue! 
    If you need further assistance, please let me know. 

    Regards,
    Petar
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top