I. Overview
1.1 Requirement
When conducting data entry preview, how to get the value of the widgets for data entry in expanded cells.
1.2 Solution
Use JS event to get the value of the widgets for corresponding rows.
II. Sample
2.1 Steps
Create a template and add the dataset ds1:
SELECT * FROM SALES_BASIC
Drag the dataset [Salesperson] into A1, and set a drop-down box widget for A1 and a button widget for B1. The drop-down box widget is expanded downwards. The template is designed as follows:
Add a JS click event to the button widget of B1:
Input the JS code:
var location = this.options.location; // Get the location of the current widget
var cr = FR.cellStr2ColumnRow(location);
var col = cr.col; // Column No.
var ro = cr.row; // Row No.
var zybck = contentPane.getWidgetByCell(FR.columnRow2CellStr({col: col-1, row: ro}));// Get the widget for corresponding cells
alert(zybck.getValue()); // Get the corresponding value
2.2 Preview
Choose [Data Entry Preview]. The preview effect is as follows: