JS Click the Button to Realize the Hyperlink Function

  • Last update:December 16, 2020
  • I. Overview

    1.1 Requirement

    How to realize dynamic parameter hyperlinks in cells by a button click, as shown below:

     

    II. Sample

    2.1Sample 1: Dynamic parameter hyperlinks

    2.1.1 Create a new decision-making report

    Create a new decision-making report and add the dataset [ds1]:

     

    2.1.2 Design the decision-making report

    Add two button widgets in the [body] and name them East China and North China, respectively. Add a report block widget and drag the data fields of ds1 into cells. The template design interface is shown as below:

     

    2.1.3 Add a click event

    Select button0 widget of the East China button and add a click event. Add two parameters at the upper right corner of the click event, as shown below:

    Parameter

    Value

    session

    sessionID

    region

    East China

    Input the JS code:

    $.ajax({
           url: '/webroot/decision/view/form?op=fr_dialog&cmd=parameters_d',
           type: 'POST',
           data: {
                  "region": region
           },
           headers: { 
                 sessionID: session
           },
           complete: function(res, status) {
                  if (window.FR && FR.Chart && FR.Chart.WebUtils) {
                         FR.Chart.WebUtils.clearCharts();
                  }
                  _g().loadContentPane();
           }
    });

    Similarly, select the widget of the North China button, and add a click event. Add two parameters at the upper right corner of the click event, as shown below:

    Save the template and preview the report.


    2.2 Example 2: Report object hyperlinks

    2.2.1 Create a decision-making report

    Create a decision-making report and add the dataset [ds1]:

     

    2.2.2 Design the decision-making report

    Add two button widgets [button0] and [button1] in the [body] and name them Hyperlinks-Report and Hyperlinks-Chart, respectively.

    Add a report block widget and a pie chart in the [body], and drag the data fields of ds1 into cells. The template design interface is shown as follows:

     

    The pie chart is set as follows: 

    2.2.3 Add a click event

    Select the button0 widget of Hyperlinks-Report button, add a click event, and input the Parameter: region and the String Value: North China at the upper right corner of the click event, as shown below:

     

    Input the JS code:

    _g().getWidgetByName('report0').gotoPage(1, {
           "region": region
    }, 'T');

    Save the template and preview the report.

    III. Preview

    3.1 Sample 1: Dynamic parameter hyperlinks 


    3.2 Sample 2: Hyperlinks-Objects in the current report

    IV. Download the template

    3.1 Sample 1: Dynamic parameter hyperlinks

    0.frm


    3.2 Sample 2: Report object hyperlinks

    1.frm



    Attachment List


    Theme: FineVis Data Visualization
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy