I. Overview
1.1 Requirement
Show the row number on the top when editing any cell in the row.
1.2 Solution
The contentPane attribute owns an event listener named cellselect, which will be triggered when a cell is selected.
II. Sample
2.1 Design a template
2.2 Add an event
Select [Template] > [Web Attributes], and choose [Data Entry Settings].
Select [Indivisually set for the report] and click [+] to add a [Load End] event.
Input the JS code:
contentPane.on("cellselect", function(td) {
//Capture the event. td is the event object, i.e. the cell that trigger the event.
var num = contentPane.curLGP.getTDRow(td) - 2;
//Get current row number. The first row begins from row 3, so the row number subtracts 2.
contentPane.curLGP.setCellValue("D1", null, num);
}); //Let D1 display the row number.
Note
To get the column number , use contentPane.curLGP.getTDCol(td). However, the column numbers are in alphabetical format, so they cannot do the subtraction directly.
2.3 Preview
Choose [Data Entry Preview]