Customizing the Toolbar Position Through JS

  • Last update:December 25, 2024
  • Overview

    Version

    Report Server VersionFunctional Change
    11.0

    /

    Expected Effect

    The report toolbar is left-aligned by default, and you can center the toolbar or align the toolbar to the right. The following figure shows the preview effect of CPT reports.

    2024-12-25_11-01-27.png

    Implementation Method

    You can change the position of the toolbar by adding a JS event.

    For details about JS APIs related to the toolbar, see Toolbar API.

    Example

    Template Design

    Open the built-in template LineForm1.cpt in the %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Form\LineForm path.

    Event Addition

    Choose Template > Web Attribute > Pagination Preview Setting, set Following Settings to Set for This Template Separately, and add a Loading Start event, as shown in the following figure.

    2024-12-25_10-51-40.png

    The JS code to center the toolbar is as follows:

    _g().getToolbar().toolBarFloat('center');

    The JS code to align the toolbar to the left is as follows:

    _g().getToolbar().toolBarFloat('left');

    The JS code to align the toolbar to the right is as follows:

    _g().getToolbar().toolBarFloat('right');

    Effect Display

    Save the template and click Pagination Preview. The following figure shows the effect.

    2024-12-25_11-30-19.png

    iconNote:
    The effect cannot be previewed on mobile terminals.

    Attachment List


    Theme: Report Application
    • 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