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

Disable link

3 Answers 390 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
ziental
Top achievements
Rank 1
ziental asked on 12 Jun 2019, 05:37 PM

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?

 

 

3 Answers, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 14 Jun 2019, 01:11 PM
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.
0
ziental
Top achievements
Rank 1
answered on 14 Jun 2019, 05:35 PM

Perfect, thank you.

 

0
Petar
Telerik team
answered on 17 Jun 2019, 10:58 AM
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.
Tags
Scheduler
Asked by
ziental
Top achievements
Rank 1
Answers by
Petar
Telerik team
ziental
Top achievements
Rank 1
Share this question
or