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

Insert and Delete after binding to Datasource

4 Answers 355 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Ani
Top achievements
Rank 1
Ani asked on 11 Apr 2016, 04:11 PM

Hi, 

  how to perform insert and delete operation after binding to a dataSource. I tried to solve in different ways but all ends in some issue.

  Create a dojo snippet to reproduce issue.

  Issues :-

  1.  After applying formula to a column data sheet.range("F2:F").formula("C2*D2");   try to add a row 

       Getting error - kendo.all.js:98306 Uncaught Error: Shifting nonblank cells off the worksheet is not supported!

   2. Change formula to sheet.range("F2:F14").formula("C2*D2"); leaving one final row.  Can insert one record.

       Is there any way to apply formula to all cells in column without affecting the add functionality.

  3. " dataSource.cancelChanges()" will  copies the below row to current row.

   

 

4 Answers, 1 is accepted

Sort by
0
Ani
Top achievements
Rank 1
answered on 11 Apr 2016, 04:21 PM

Which is the best way to perform CRUD operation in spreadsheet when bind to datasource.

for inserting -   spreadsheet.insertRow( )  or  dataSource.insert

0
Alex Gyoshev
Telerik team
answered on 14 Apr 2016, 07:15 AM

Hello Ani,

Adding a formula to the spreadsheet marks it as containing data. Thus, when you add the formula to all rows, you fill out the complete spreadsheet with rows with default data. You may want to insert the formula only on actual data rows.

Inserting rows via the DataSource may be easier to reason about. Note that formulas are not persisted, and you may need to add formulas to the rows after inserting new records.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ani
Top achievements
Rank 1
answered on 26 Apr 2016, 02:59 PM

Hi Alex, 

 Thanks for the response. 

 [quote]

Inserting rows via the DataSource may be easier to reason about. Note that formulas are not persisted, and you may need to add formulas to the rows after inserting new records

 [/quote]

 That mean we need to add formulas to the newly inserted row only.

 What happening now is formulas are getting cleared for all cells after inserting new row. Is it an expected behaviour

0
Alex Gyoshev
Telerik team
answered on 28 Apr 2016, 02:19 PM

Hello Ani,

What I meant in my previous post was that you can apply formulas to cells after a new row has been inserted. Can you please elaborate what problem you are facing?

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Spreadsheet
Asked by
Ani
Top achievements
Rank 1
Answers by
Ani
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or