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

Appointment is invalid and Cannot Read Property errors for Scheduler in Chrome 61

1 Answer 182 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Telerik Admin
Top achievements
Rank 1
Telerik Admin asked on 18 Oct 2017, 01:31 PM | edited on 25 May 2021, 08:11 AM

*** Update from 17 Jan 2018 ***

The problem discussed below has been fixed in R1 2018 (2018.1.117).

*** End of update ***

The new Chrome 61 introduces some breaking changes which may lead to some of the following errors when the browser is scrolled and the resize handler of an appointment is clicked:

  • Uncaught TypeError: Cannot read property ‘viewPartIndex’ of null

  • Sys.WebForms.PageRequestManagerServerErrorException: Appointment Start time must be before the End time

  • Uncaught TypeError: Cannot read property 'cells' of undefined

  • Uncaught TypeError: Cannot read property 'resizeFromStart' of null

  • Uncaught TypeError: Cannot read property 'intervalIndex' of null;


Solution:

Placing the following JavaScript override before the declaration of the Scheduler should resolve all of the above issues:  

<script type="text/javascript">
    Telerik.Web.UI.RadScheduler.prototype._compensateScrollOffset = function(contentTable) {
        //In Chrome and Safari document.documentElement.scrollTop is always 0, due to a browser bug
        //In Internet Explorer there is no "document.scrollingElement"
        var scrollingElement;
        if ($telerik.isSafari || $telerik.isChrome) {
            scrollingElement = document.body.scrollTop <= document.scrollingElement.scrollTop ? document.scrollingElement : document.body;
        }
 
        var bodyOffsetElement = scrollingElement ? scrollingElement : document.documentElement,
        bodyScrollOffset = $telerik.getScrollOffset(bodyOffsetElement, false),
        scrollOffset = $telerik.getScrollOffset(contentTable, true);
 
        scrollOffset.x -= bodyScrollOffset.x;
        scrollOffset.y -= bodyScrollOffset.y;
 
        contentTable.targetRect.x += scrollOffset.x;
        contentTable.targetRect.y += scrollOffset.y;
 
        // The Safari issue here could be a problem in getLocation (used in getBounds). This code offsets it
        //if($telerik.isSafari3 || $telerik.isSafari4 || $telerik.isChrome)
        //{
        //    contentTable.targetRect.x += scrollOffset.x;
        //    contentTable.targetRect.y += scrollOffset.y;
        //}
    }
</script>


<telerik:RadScheduler runat="server" ID="RadScheduler1" ... >

If any other issues are observed in Chrome 61+ environment, please share them along with more details and specific examples of the reproduction steps so we can update the information here. 

For more information on the Google Chrome update and any issues with the position of ToolTips and ContextMenus, you may refer to http://www.telerik.com/forums/wrong-placement-of-radcontextmenu-in-chrome-61

Edward
Top achievements
Rank 1
commented on 23 May 2021, 03:08 PM

The colon in the first line should be an equals sign, shouldn't it? It should read: Telerik.Web.UI.RadScheduler.prototype._compensateScrollOffset = function(contentTable) {

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 25 May 2021, 08:12 AM

Hi,

You are absolutely correct, Edward - thank you for pointing this out, I have updated it right away.

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Scheduler
Asked by
Telerik Admin
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or