I. Description
When a field in the table saves a web page address, how to click on a cell to pop up a dialog box to display the web page, as shown in Figure 1:
The URL format of the hyperlink is fixed, but some of the values are different. How to open the corresponding page by clicking the cell to replace the corresponding URL value? Figure 2:
II. Example1
Prepare the dataset Embedded1 as follows:
Drag the dataset field into the cell:
Select cells A1 and B1, right-click and select the Hyperlink, add JavaScript, add two parameters title and url in the parameter bar, the parameter values are formula A1, B1, and add the following JavaScript code:
var iframe = $("<iframe id='inp' name='inp' width='100%' height='100%' scrolling='yes' frameborder='0'>");
iframe.attr("src", url);
var o = {
width : 960,
height: 550
};
FR.showDialog(title, o.width, o.height, iframe,o);
Save the template and click on the pagination preview to see the above effect.
Provide a more concise method:
Set the super link directly in cell B1 and add parameter a:
Pass the current URL and use window.open to open the URL as a new page.
III. Example2
Another situation: The URL format of the hyperlink is uniform, but a certain value is different. Passing the parameters directly behind the URL is not easy to achieve.
As shown in the figure: the format of [URL] is the same, but the value of [Homepage ID] is different.
1) Prepare the dataset:
2) Select A2, right-click and select [Hyperlink], add [JavaScript], add the parameter [p_name] in the parameter column, the parameter value is the formula [B2], and add the following JavaScript code:
window.open('https://help.fanruan.com/finereport-en10.0/doc-view-' + p_name + '.html', '_blank');
Save the template and click on the pagination preview to see the above effect.
Note: URL format-http://www.baidu.com; don’t miss http://
4. Template download
1. Example1
Click to download:
Hyperlink_by_content-example1.cpt
2. Example2
Click to download:
Hyperlink_by_content-example2.cpt