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

Focus and Select Scheduler slot programmatically

9 Answers 218 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
W
Top achievements
Rank 1
W asked on 25 Nov 2014, 01:37 PM
I have multiple scheduler components and only one can be active at a time,
When a scheduler is switch and "right-click"/context-menu is triggered on a slot in a newly switched scheduler, an error message occur: "Unable to get property 'getFullYear' of undefined or null reference" - in kendo.all.min.js

This message will pop up on IE and trigger an error message in the console on Google Chrome,
So far the error doesn't have any impact in general, just an annoying error message,

Apparently, it won't trigger any error if "left-click" is triggered first on a slot in a newly switched scheduler before the "context-menu", and I realized that the "left-click" will give a focus and select a slot on a current scheduler. But the focus won't be given automatically by simply switching the scheduler,
I switch the scheduler only by clicking a button that will set the display of a div to 'block' and zindex to '100' and then refresh the scheduler with .refresh(). The div has scheduler inside of it.
So in general, the switching looks like this:
var calendar1=document.getElementById("div1").firstChild;
var calendar2=document.getElementById("div2").firstChild;
$("#btn1").click(function(){
   $("#div2").css("display","none").css("z-index","-1");
   $("#div1").css("display","block").css("z-index","100");
   $(calendar1).data("kendoScheduler").refresh();
});
$("#btn2").click(function(){
   $("#div1").css("display","none").css("z-index","-1");
   $("#div2").css("display","block").css("z-index","100");
   $(calendar2).data("kendoScheduler").refresh();
});

When the switching occur, the scheduler won't switch the focus, how can I select a slot on a newly switched scheduler or at least give a focus to the newly switched scheduler?
Because focus() method will not select a slot and it will still trigger the error

9 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 27 Nov 2014, 09:32 AM
Hello,

The described issue is not a known problem. Could you provide more details and if possible runnable demo that demonstrates the problem ? This will help us to investigate further the case and follow you up with more details.


Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
W
Top achievements
Rank 1
answered on 27 Nov 2014, 11:13 AM
Thank you for your response,

here is a simple demo that represents the error:
Demo

if you click on button "see schedule 2" then it will switch to schedule number 2, 
and then if you right-click on the scheduler afterwards, then you will get the "getFullYear" error on the console,

However, I managed to switch focus by adding the .refresh() functionality so it can remember the last focus and select that slot,but if you've never left-click or give focus onto the scheduler before, then it won't select any slot

0
Georgi Krustev
Telerik team
answered on 28 Nov 2014, 12:27 PM
Hello,

Thank you for the repro demo. It seems that this is bug related to our initial focusing behavior. I have logged the issue in our product backlog and will address is for the next service pack of Kendo UI.

As a gratitude for your involvement I updated your Telerik points.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Scott
Top achievements
Rank 1
answered on 31 Aug 2015, 05:43 PM
Was this bug ever fixed?  I am using Kendo version v2015.2.624 and I keep running into this error.  I'm using the Kendo Scheduler in timeline view, and when a user clicks on a timeslot, I automatically create an event in that timeslot.  The issue is that about 1 in every 3 or 4 times I run the application, I get this same "Unable to get property 'getFullYear' of undefined or null reference" error, but only when clicking on certain timeslots.  I can't seem to find any pattern as to when or why some of the slots give this error when clicked, whereas the majority of the others all work fine.  Attached is the error and place in the Kendo code that the error is thrown.
0
Vladimir Iliev
Telerik team
answered on 02 Sep 2015, 08:58 AM
Hello Scott,

The previously reported issue is already fixed on our side (as seen in this demo) - that why I would ask you to provide runable example where the issue is reproduced inside the other support thread that you opened?

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Scott
Top achievements
Rank 1
answered on 02 Sep 2015, 04:51 PM
What demo are you referring to?  Your link simply links back to this forum post.
0
Vladimir Iliev
Telerik team
answered on 03 Sep 2015, 06:56 AM
Hello Scott,

Please check the working link below:

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Dakshi
Top achievements
Rank 1
answered on 10 Feb 2020, 10:28 AM

Hi Vladimir Iliev,

 I am also facing same Cannot read property 'getFullYear' of undefined Issue.

and i tried to open link given by you http://dojo.telerik.com/UTepi is not opening saying "There is a problem with the page. Please reload the page." ...

0
Martin
Telerik team
answered on 12 Feb 2020, 09:19 AM

Hello Dakshi,

You will find my reply in the support thread you opened on the subject. I suggest to continue the communication there.

Regards,
Martin
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
W
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
W
Top achievements
Rank 1
Scott
Top achievements
Rank 1
Vladimir Iliev
Telerik team
Dakshi
Top achievements
Rank 1
Martin
Telerik team
Share this question
or