Overview
Problem
During data entry preview, you may want the cursor to be automatically placed at a specific widget after page loading is finished, allowing you to edit the widget directly. This solution applies to scenarios where data entry shortcuts are set.

Implementation Method
You can use the relevant API in the corresponding event to realize the effect.
Example One: Widget in a Cell
Widget Adding
Create a general report and add a widget, as shown in the following figure.

Loading End Event Setting
1. Choose Template > Web Attribute > Data Entry Setting, set Following Settings to Set for This Template Separately, and add a Loading End event in Event Setting, as shown in the following figure.

The JavaScript code is as follows.
var cell = _g().curLGP.getTDCell(0, 1);
//Obtain cell A2.
setTimeout(function() {
_g().curLGP.selectTDCell(cell);
_g().curLGP.editTDCell(cell);
//Set the focus to cell A2.
}, 50);
Effect Preview
Save the template and click Data Entry Preview. The following figure shows the effect.

Note:Example Two: Widget on the Parameter Panel
Widget Adding
Create a general report and add a widget, as shown in the following figure.

After Initialization Event Adding
1. Add an After Initialization event for the widget.

The JavaScript code is as follows.
var a = this;
//Obtain the current widget object.
setTimeout(function() {
a.editComp.focus();
//Set the focus.
}, 50)
Effect Preview
Save the template and click Data Entry Preview. The following figure shows the effect.

Note: Template Download
For details, you can download the templates:
Example One: Setting the Focus to Be a Widget in a Cell by JS.cpt
Example Two: Setting the Focus to Be a Widget on the Parameter Panel by JS.cpt