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

Getting Cell row and column index onSelect

1 Answer 188 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 30 Jan 2018, 09:50 PM

I have no issue getting the value from the cell using:

funciton onSelect(arg) {

var cellvalue = arg.range.value();

}

Do you have documentation on how to get the selected column and row index?

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 02 Feb 2018, 09:40 AM
Hello Paul,

You could get the indexes of the row and the column of the selected cell by using the topLeft() method of the range object:
function onSelect(arg) {
  var cellvalue = arg.range.value();
  var topLeft = arg.range.topLeft();
  var row = topLeft.row;
  var col = topLeft.col;
 
  console.log(row);
  console.log(col);
}

I am afraid, that the above method is currently not documented in the Range object API.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular 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
Paul
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or