mardi 7 février 2017

What causes kendo to throw an "Cannot read property 'offsetTop' of null" js error?

Vote count: 0

I get the following kendo js error and stack trace from a page with a kendo grid with the error coming in about once or twice a day at random from end users:

Message: Cannot read property 'offsetTop' of null

at offsetTop line 28097, column 35 (/source//kendo.all.js:28097)

    var itemHeight = $(element.children[0]).height();
    var itemIndex = Math.floor(scrollTop / itemHeight) || 0;
    var item = element.children[itemIndex] || element.lastChild;
    var forward = item.offsetTop < scrollTop;
    while (item) {
        if (forward) {
            if (item.offsetTop + itemHeight > scrollTop || !item.nextSibling) {

at _firstVisibleItem line 28127, column 39 (/source//kendo.all.js:28127)

    if (!template) {
        return;
    }
    var visibleItem = this._firstVisibleItem();
    if (visibleItem) {
        this.header.html(template(visibleItem.group));
    }

at _renderHeader line 27650, column 29 (/source//kendo.all.js:27650)

            var that = this;
            clearTimeout(that._scrollId);
            that._scrollId = setTimeout(function () {
                that._renderHeader();
            }, 50);
        }, this);
    },

Its not clear if the error is having any impact, but any error is disturbing and takes up room in our error log. My best guess is that the error occurs while the user is navigating away from the page. Perhaps there is a way to dispose of the grid safely without issue. Though the problem could be something else entirely.

I'm using the latest kendo release from January 2017, but I've seen it on previous versions as well.

Is there anything that can be done to eliminate this error, or can it be safely ignored?

asked 10 secs ago

Let's block ads! (Why?)



What causes kendo to throw an "Cannot read property 'offsetTop' of null" js error?

Aucun commentaire:

Enregistrer un commentaire