Version
Version | Functional Change |
---|---|
11.0 | Difference from 10.0:
|
1. To using all toolbar APIs in a general report, only one toolbar (either the top or bottom toolbar) can exist in the report.
2. The following APIs cannot be used in the FVS visualization dashboard.
Before API use, read JS API Compatibility Description carefully. APIs are supported in both general reports and dashboards (new version) by default.
getWidgetByName
Method | getWidgetByName(name) | This API is used to get the button on the report toolbar and can be used with the button methods. |
---|---|---|
Parameter | name: string | Button name, which is a string. The following lists common button names.
Note: The export button is supported only in 11.0.27 and later versions.
|
Returned Value | Button object | object |
Example | Example 1: If the obtained toolbar object is defined as toolbar, get the email button on the toolbar using the following command. toolbar.getWidgetByName("email"); Example 2: Get the email button on the toolbar in a general report using the following command.
| |
Application Example | After successful submission, the Email and Print buttons are hidden on the toolbar. Click to download the template: Invisible Toolbar Button.cpt. | |
Mobile Terminal | This API is not supported on mobile terminals. |
getToolbar
Usage in General Reports | getToolbar() | This API is used to get the toolbar object. |
---|---|---|
Parameter | / | / |
Returned Value | Button object | object |
Example | Example 1: If the obtained report object is defined as report, get the toolbar object using the following command. report.getToolbar(); Example 2: Get the toolbar object in a general report using the following command. _g().getToolbar(); | |
Application Example | / | |
Mobile Terminal | This API is supported on mobile terminals. |
The following table describes how to us this API in dashboards.
Usage in Dashboards | getToolbar(index) | This API is used to get the report block toolbar and can be used when the toolbar is open. After getting the toolbar, you can use the toolbar API and toolbar button API. |
---|---|---|
Parameter | index: number | Toolbar position, which is a number.
|
Returned Value | Toolbar object | object |
Example | Example 1: If the obtained report block object is defined as report, get the toolbar object using the following command. report.getToolbar(0); Example 2: Get the top toolbar object of the report0 block in a dashboard using the following command. _g().getWidgetByName("report0").getToolbar(0); Example 3: Get and hide the top toolbar of the report0 block in a dashboard using the following command.
| |
Application Example | Click the button to hide the report block toolbar in a dashboard. Click to download the template: Hiding the Report Block Toolbar.frm. | |
Mobile Terminal | This API is supported on mobile terminals. |
toolBarFloat
Method | toolBarFloat(direction) | This API is used to set the toolbar display position. |
---|---|---|
Parameter | direction: string | Display method, which is a string.
|
Returned Value | void | |
Example | Example 1: If the obtained toolbar object is defined as toolbar, center the toolbar using the following command. toolbar.toolBarFloat('center'); Example 2: Center the toolbar in a general report using the following command. _g().getToolbar().toolBarFloat('center'); Example 3: Center the toolbar in a dashboard using the following command. _g().getWidgetByName('report0').getToolbar(0).toolBarFloat('center'); | |
Application Example | Center the toolbar in a general report. Click to download the template: Centered Toolbar.cpt. | |
Mobile Terminal | This API is not supported on mobile terminals. |
setStyle
Method | setStyle(style) | This API is used to resize the toolbar. |
---|---|---|
Parameter | style: { width: number, height: number } | Toolbar size, which is in JSON format.
|
Returned Value | void | |
Example | Example 1: If the obtained toolbar object is defined as toolbar, resize the toolbar to 900 in lenght and 60 in height using the following command. toolbar.setStyle({ width: 900, height: 60}); Example 2: Resize the toolbar to 900 in lenght and 60 in height in a general report using the following command. _g().getToolbar().setStyle({ width: 900, height: 60}); Example 3: Resize the toolbar to 900 in lenght and 60 in height in a dashboard using the following command.
| |
Application Example | Resize the toolbar to 900 in lenght and 60 in height in a general report. Click to download the template: Toolbar Resizing.cpt. | |
Mobile Terminal | This API is not supported on mobile terminals. |
setVisible
Method | setVisible(visibility) | This API is used to show/hide the toolbar. |
---|---|---|
Parameter | visibility: boolean | Whether to show the toolbar (boolean type).
|
Returned Value | void | |
Example | Example 1: If the obtained toolbar object is defined as toolbar, hide the toolbar using the following command. toolbar.setVisible(false); Example 2: Hide the toolbar in a general report using the following command. _g().getToolbar().setVisible(false); Example 3: Hide the toolbar in a dashboard using the following command.
| |
Application Example | Hide the toolbar in a general report. Click to download the template: Toolbar Hiding.cpt. | |
Mobile Terminal | This API is supported on mobile terminals. |