Completed
Last Updated: 26 Mar 2021 15:06 by ADMIN
Release R1 2021 SP2
Andrew
Created on: 02 Mar 2021 10:16
Category: Spreadsheet
Type: Bug Report
2
Uncaught TypeError: Cannot read property 'offsetWidth' of undefined when updating a cell in spreadsheet

Getting these errors when trying to update spreadsheet cells. Uncaught TypeError: Cannot read property 'offsetWidth' of undefined


The issue is happening even on the demo component when editing a cell:

https://demos.telerik.com/aspnet-ajax/spreadsheet/examples/overview/defaultcs.aspx

Workaround from Admin: 

Load the following script under the ScriptManager:

<script>
    if (kendo && kendo.spreadsheet && kendo.spreadsheet.SheetEditor) {
        kendo.spreadsheet.SheetEditor.fn.activate = function (options) {
            var viewElement = this.view.element, viewWidth, scrollerElement, scrollbarWidth;
            this._active = true;
            this._rect = options.rect;
            this._range = options.range;
            this.cellInput.position(options.rect);
            this.cellInput.resize(options.rect);
            this.cellInput.tooltip(options.tooltip);
            this.cellInput.activeCell = this.barInput.activeCell = this._range.topLeft();
            this.cellInput.activeSheet = this.barInput.activeSheet = this._range._sheet;
            if (viewElement) {
                viewWidth = viewElement.width();
                scrollerElement = viewElement.find('.' + kendo.spreadsheet.View.classNames.scroller)[0];
                scrollbarWidth = scrollerElement.offsetWidth - scrollerElement.clientWidth;
                this.cellInput.element.css('max-width', viewWidth - scrollbarWidth - this.cellInput.element.position().left + 'px');
            }
            this.trigger('activate');
            return this;
        }
    }
</script>

  

2 comments
ADMIN
Rumen
Posted on: 26 Mar 2021 15:06

Hi Andrew,

Thank you for the bug report!

I have good news that the problem is resolved and the fix will appear on March 30, 2021, with the R1 2021 SP2 release.

Best Regards,
Rumen
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Andrew
Posted on: 09 Mar 2021 14:39
This prevents users from editing the cell with a single click. The user needs to double click the cell to modify the values which is not as intuitive (I thought it was broken because of this).