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

Clear contents of Cell Editor

2 Answers 55 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Christy
Top achievements
Rank 1
Christy asked on 19 Jan 2017, 07:15 PM

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 Answers, 1 is accepted

Sort by
0
Christy
Top achievements
Rank 1
answered on 19 Jan 2017, 07:22 PM

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();
0
Boyan Dimitrov
Telerik team
answered on 23 Jan 2017, 12:36 PM

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.
Tags
Spreadsheet
Asked by
Christy
Top achievements
Rank 1
Answers by
Christy
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or