JS Get the Values from Report Widget in the Parameter Pane

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

    1.1 Requirement

    How to get report body widget value by appropriately setting the parameter pane of the decision-making report?


    1.2 Solution

    Get report body widget value by inputting JS code:

    _g().getWidgetByName("area").getValue(); // Get the value of the Area Widget for the report body.

    II. Steps

    1) Create a new decision-making report and set the body’s  Layout Type as Absolute Layout:

     

    2) Drag the Label Widget and the Text Widget into the report body and set the value of the Label Widget as Area:

     

    3) Set the name of the Text Widget as area:

     

    4) Drag the parameter pane into the report body, add a Button Widget, and set the Widget Name as Get report body widget value:

     

    5) Select the button0 and add a Click Event:

     

    Input the JS code:

    var label = _g().getWidgetByName("label0").getValue(); // Get the value of label0
    var area = _g().getWidgetByName("area").getValue(); // Get the value of areaalert(label + area); 

    6) Click the white space of the parameter pane and uncheck [Display Nothing Before Query]:

     

    7) Save the template and click [Preview]. The preview effect is shown as above.

    III. Preview

    Save the templates and select [Dashboard Preview]. The preview effect is as shown below:

    IV. Download the template

    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