Clear contents of Cell Editor

3 posts, 0 answers
  1. Christy
    Christy avatar
    48 posts
    Member since:
    May 2016

    Posted 19 Jan Link to this post

    I have an application that uses the spreadsheet to upload data within an angular component on my page. The component allows the user to click either an Update or Cancel button when they are done with any additional editing on the spreadsheet. This works fine, except when the user edits a cell and then clicks a button without moving to another cell in the spreadsheet.  According to some of the documentation, I should be able to call the change event on the spreadsheet to set this, but this seems to occur AFTER the calls to the button events. 

    I have been able to set the value of the cell to the value in the editor using $('.k-spreadsheet .k-spreadsheet-view .k-spreadsheet-cell-editor'). However, if the user then tries to open another spreadsheet within this component, the value for this element is what they had been typing prior to hitting the Update or Cancel button. This then appears to overwrite that cell on the new spreadsheet, although it is not saved when the user selects another cell. In other words, if the user is in cell C3 typing 'my new text' without moving to another cell, clicks Update, and clicks Add Another Spreadsheet on the parent component, cell C3 of the new spreadsheet will read 'my new text' regardless of what was in that cell in the Excel file. If the user then clicks on another cell, the original value does show, but it's confusing to the users.

    Is there any way to clear the contents of the k-spreadsheet-cell-editor div tag? I have tried setting it to '', but then it removes the text from the corresponding cell on the new spreadsheet.

    I know you are going to want a demo, but this is a VERY complex application and I have very little time to fix this. I JUST need a way to clear that information so that it is not stored in the angular component's view when a new sheet is rendered.

    Thanks!

  2. Christy
    Christy avatar
    48 posts
    Member since:
    May 2016

    Posted 19 Jan in reply to Christy Link to this post

    I should mention that I have the following to clear the contents of the spreadsheet:

    // In view, k-scope-field = "spreadsheet"
    var spreadsheet = $scope.spreadsheet;
    var sheet = spreadsheet.activeSheet();
    sheet.range(kendo.spreadsheet.SHEETREF).clear();
  3. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1968 posts

    Posted 23 Jan Link to this post

    Hello,

    I managed to replicate this problem, but updating the Kendo UI script versions to the latest official seems to solve the problem. Please try to test your case with Kendo UI 2017.1.118 version. 

    Regards,
    Boyan Dimitrov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top