Dashboard query after clicking query widget

  • Last update:February 10, 2022
  • I. Overview

    1. problem description

    In some cases, the widget in the body component of the dashboard will trigger the query action immediately after entering the query parameters.

    However, sometimes you want to set a query button just like the parameter pane of normal reports. Click the query button to trigger the query action, as shown in the figure below:

    Kapture 2021-01-27 at 10.41.37.gif


    2. Solution

    In the After editing event of the widget, use return false to prevent the original query effect, and then use gotopage in the query button to refresh the report block and achieve the passing parameter effect.

    II. Example

    1. Report design

    1) When creating a new dashboard, the body component adopts absolute layout. As shown in the figure below, drag the label widget, drop-down check box widget, button widget, and report block into the design body to adjust the size and layout.

    截屏2021-01-27 上午10.44.17.png

    2) Select the drop-down check box widget, set the widget name to a, and define the data dictionary.

    截屏2021-01-27 上午10.44.41.png

    The custom data dictionary is also shown above.

    3) Select the drop-down check box widget to add a After editing event. The JS code is as follows:

    return false;

    4) Select the button widget, rename it to query, and add a click event to the control. The JS code is as follows:

    var a=_ g().getWidgetByName('a').getValue();
    this.options.form .getWidgetByName("report0").gotoPage(1,"{a:'"+a+"'}",true);


    5) Add formula split ($a, ',') to A1 cell of report block as shown in II.1.1).


    2. Effect preview

    Save the report and click pagination preview. The effect is as shown in the I.1 description.

    Note: mobile terminal is not supported.

    III. Template download

    For completed templates, please refer to:

    %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Dashboard\DashboardQuery.frm

    Click to download the template: 

    DashboardQuery.frm

    Attachment List


    Theme: FineVis Data Visualization
    Already the First
    Already the Last
    • 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