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

Get all cells or rows of a spreadsheet workbook

3 Answers 543 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Henrik
Top achievements
Rank 1
Henrik asked on 14 Dec 2016, 05:02 PM

When no range is selected how do I then in javaScript get all rows for a spreadsheet ?

This does not work

var values = sheet._rows.values();
for (var row = 0; (row < values.length) ; row++) {

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 16 Dec 2016, 09:20 AM
Hi,

You may use the range() method to get or set values for cells in that range. Here is a Dojo sample.

Regards,
Dimitar
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.
0
Henrik
Top achievements
Rank 1
answered on 16 Dec 2016, 09:25 AM

Thanks for the answer Dimitar

I know the range method. But how to I get all values in a active spreadsheet without any range selected. I need to loop through all rows

 

0
Dimitar
Telerik team
answered on 16 Dec 2016, 01:18 PM
Hi,

You may iterate over the rows count and columns count and pass the respective indexes to the range() method. Thus, you could avoid hardcoding the range. Still the range method should be used. Here is a Dojo sample. I hope it fits your case.

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