Overview
Problem
You want to obtain the corresponding row index when you click a cell in a certain row, as shown in the following figure.

Implementation Method
You can set a cellselect event listener to obtain the corresponding row index of the selected cell and display the row index in a designated cell.
Note:Example
Template Preparation
1. Create a template, and create a database query dataset ds1 with the SQL statement SELECT * FROM Sales.
2. Design the template style, and add text widgets to cells A3 to F3, respectively, as shown in the following figure.

Event Adding
Choose Template > Web Attribute > Data Entry Setting, select Set for This Template Separately in Following Settings, and add a Loading End event to display the row index of the selected cell in cell F1, as shown in the following figure.

The JS code is as follows:
_g().on("cellselect", function(td) {
//Set an event listener for cell selection.
var num = _g().curLGP.getTDRow(td) - 2;
//Get the current row index and subtract two from the index since the data starts from row three.
_g().setCellValue("F1", null, num);
//Assign a value to cell F1.
})
Note:Effect Preview
Save the template and click Data Entry Preview. The following figure shows the effect.

Template Download
For details, you can download the template Obtaining the Row Index of the Current Cell Being Edited.cpt.