Toolbar API

  • Last update:  2022-02-14
  • Note: When the following toolbar interfaces are used in general reports, only one toolbar is required in the report, that is, there is only one toolbar at the top or one at the bottom.

    getWidgetByName

    MethodgetWidgetByName(name)Get the button in the report toolbar, which can be used in combination with the button method
      Parametername: string

    Button name, string, the following are the names of common buttons

    • submit:submit button

    • verify:Data verification

    • first:First page

    • previous:Previous page

    • next:Next page

    •  last:Last page

    • flashprint:print(client)

    • email:email

    • PDF:pdf

    • pagenavi :Current Page/Total Pages

    • stash:Temporary storage

    • clear:Clear all

    Return valuebutton objectobject
       Example

    Example 1: If the obtained toolbar object is defined as toolbar , get the mail button in the toolbar

    toolbar.getWidgetByName("email");

    Example 2: Get the mail button in the toolbar in a general report

    _g().getToolbar().getWidgetByName("email");

    Application

    example

    After the data entry is successful, the toolbar hides the "Mail" and "Print" buttons:

    Click to download template: 

    Toolbar buttons are invisible.cpt

    1.gif

    MobileNot support mobile terminal

    toolBarFloat

    MethodtoolBarFloat(direction)Set the toolbar display position
      Parameterdirection: string

    Display method

    • left:Display left

    • right:Display right

    • center:Display center

    Return valuevoid
       Example

    Example 1: If the obtained toolbar object is defined as toolbar , set the toolbar to be displayed in the center

    toolbar.toolBarFloat('center');

    Example 2: Set the toolbar to be centered in a general report

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

    Application

    example

    In a general report, set the toolbar to be centered:

    Click to download the template: 

    Toolbar centered.cpt

    2.png

    MobileNot support mobile terminal

    setStyle

    MethodsetStyle(style)Modify toolbar size
      Parameterstyle:

    {

        width: number,

        height: number

    }

    Toolbar size,json format

    • width: toolbar width

    • height: toolbar height

    Return valuevoid
       Example

    Example 1: If the acquired toolbar object is defined as toolbar , modify the toolbar size to be 900 in width and 60 in height

    toolbar.setStyle({
        width: 900,
        height: 60
    });

    Example 2: Modify the size of the toolbar in a general report to be 900 wide and 60 high

    _g().getToolbar().setStyle({
        width: 900,
        height: 60
    });

    Application

    example

    In a general report, set the toolbar width to 900 and height to 60:

    Click to download the template: 

    Modify toolbar size.cpt

    3.png

    MobileNot support mobile terminal

    setVisible

    MethodsetVisible(visbility)Set toolbar visible/invisible
      Parameter

    visbility: boolean

    Whether toolbar is visible, boolean

    • true: toolbar is visible

    • false: toolbar is invisible

    Return valuevoid
       Example

    Example 1: If the obtained toolbar object is defined as toolbar , the toolbar is invisible

    toolbar.setVisible(false);

    Example 2: Toolbar is invisible in general report

    _g().getToolbar().setVisible(false);

    Application

    example

    Toolbar is invisible in general report:

    Click to download the template: 

    Hide toolbar.cpt

    4.png

    MobileNot support mobile terminal


    Attachment List


    Theme: Secondary Development
    • 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