Declined
Last Updated: 03 May 2019 10:31 by ADMIN
Bryan
Created on: 26 Mar 2019 21:37
Category: Spreadsheet
Type: Feature Request
1
Adding actual rows to sheet

In my testing of utilizing the spreadsheet component and starting off with for example 100 rows in the configuration options, using insert row typically seems to shift the data down (if you have anything below the cursor). It does not actually increase the number of rows in the sheet. 

 

For example if I initialize the spreadsheet with the following info:

$("#spreadsheet").kendoSpreadsheet({
        rows: 100,
        columns: 26
});

 

This will create the spreadsheet with 100 rows and columns A-Z as expected.

Now going anywhere in the sheet (or the end) and inserting a row above/or below will not add row 101, 102, 103, etc. In fact, if you are in the very last row and hit insert row below it will come up with a message regarding a possible loss of data. 

A couple things I have tried:

  • Utilizing the insertRow event and setting a flag for when the next render call happens to recreate the sheet using the fromJSON() function.This mostly works actually, however if you try this while the cursor is near the last row (within 1-2 cells) there seems to be some sort of bug that the data from toJSON() removes the data from rows 1 and 2, but only after column 2. For example see attached screenshot
  • Utilizing the insertRow event and updating event.sender.options.rows to increase by 1, it does something meaning the container expands in height by a little bit, but its an empty "row" with no grids and you cannot add content (it also does not have an # for the row). Looking at the actual JSON data it appears there are a lot of other locations rows is set, in the sheet, in the view, grid, etc.

 

So with that said, is it at all possible to actually add a row to the sheet as one would expect the behavior to be. This obviously still needs to call the internal functions to recalculate the ranges and data throughout the sheet; but somehow re-fresh or re-render the UI component (just calling render again doesn't fix it).

 

 

I appreciate your help with this.

5 comments
ADMIN
Dimitar
Posted on: 03 May 2019 10:29
Hello,

This feature is a duplicate of the following item:


Please redirect all comments and feedback to the above-linked feature request. 

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
ADMIN
Petar
Posted on: 01 Apr 2019 11:49
Hello Bryan,

Thank you for your feedback. Your issue has been reported as a bug and you can follow its public thread on this link: https://feedback.telerik.com/kendo-jquery-ui/1402289-adding-actual-rows-to-sheet 

I've updated your Telerik points as a sign of gratitude. 

Regards,
Petar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Bryan
Posted on: 28 Mar 2019 17:04

Hi again, 

To be more clear and hopefully help communicate the issue better, I have written some steps to reproduce the issue.

  1. Insert data into first row (each comma signifies a new column):     Foo, Bar, Tar
  2. Scroll to end of sheet, select row 199 or 200
  3. Click "Insert Below"
  4. Scroll up to row 1 again to find only Row 1, Column 1 left with "Foo" and "Bar" and "Tar" have disappeared

So it seems that for some reason if you attempt to insertRow while too close to the end of the sheet it will remove data from the top of the sheet. 

While testing, I was able to verify the data actually disappears during the insertRow event and using toJSON to read what is in those cells.

 

Please let me know if you need anymore info from me to help replicate this.

Bryan
Posted on: 28 Mar 2019 16:42

Hi Petar,

Thanks for responding! I do have the functionality working where it adds the row to the sheet using the same method you did with the toJSON and fromJSON functions.

 

However, the issue which I described which can be seen in the original screenshot I attached is that if the user is at the end of the sheet already (either 199 or 200.. both break) it deletes data. For some reason if you use the insertRow button on either of those rows (or just the last 2 with any amount of rows) the toJSON function returns all of the data EXCEPT for rows 1 and 2 starting at column 1 (as shown in my screenshot). So column 1 is left intact, and starting in column 2, the data is missing. 

 

This can be tested on your Dojo link you provided. So it appears to be a bug from within the actual component unfortunately.

ADMIN
Petar
Posted on: 28 Mar 2019 12:01
Hello Bryan,

The expected behavior of the "Insert row" functionality of Spreadsheet is as described by you - the rows are shifting down and no new rows are being added.  

In this Dojo, you will find an example that adds 5 new lines to the SpreadSheet when pressing the button below it. This example is working with toJson() and fromJson() methods of the SpreadSheet. I've tested the scenario described by you, but on my side, everything is working correctly - the data is being copied and there is no data loss in the first two rows.

You can attach the snippet that adds the new rows to an event that fits your logic and thus add new rows in the SpreadSheet when needed.

Regards,
Petar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.