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

How to get total rows count of kendo ui spreadsheet

1 Answer 1166 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Vijayakumar
Top achievements
Rank 1
Vijayakumar asked on 21 Dec 2016, 08:12 AM

I have a Kendo UI Spreadsheet. How do I get the rows count of latest added rows? Say the spreadsheet is empty, I have added data for 2 rows. How do I get the row count. I am using, 

var grid = $("#spreadsheet").data("kendoSpreadsheet");
       var sheet = grid.sheetByIndex(0);
       var data = sheet.toJSON();
       var totalRowsCount = data.rows.length;

Here, the totalRowsCount does not always get data rows count and gets total rows that I have defined for my kendo spreadsheet. 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 23 Dec 2016, 08:17 AM
Hello Vijayakumar,

If the desired result is to get the number of latest added rows, I can suggest having two additional variables to track the old and the new row numbers. This will help to determine how many rows are newly added.

I made a Dojo example based on the provided code to demonstrate this implementation:

http://dojo.telerik.com/iGEbE

I hope this is helpful.

Regards,
Stefan
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
Vijayakumar
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or