Version
Version | Functional Change |
11.0 | Differences from V10.0: The getType, setWaterMark, and setPopupStyle interfaces were added. |
11.0.7 | The FVS Dashboard Edit Mode plugin of V1.5.0 added widget components, adapting to some interfaces. Difference from ordinary reports and dashboards: _g().xxx needs to be replaced with duchamp.xxx. |
11.0.11 | For App/HTML5 V11.0.76 and later versions, the return false interface is partially supported on mobile terminals. |
Interfaces are supported in both ordinary reports and dashboards (new version) by default.
getValue
Method | getValue() | Obtains the actual value of widgets. |
Parameter | / | / |
Return Value | any | |
Example | One: If the obtained widget object is defined as widget, obtain the actual value of the widget.
Two: Obtain the actual value of the text0 widget on the parameter panel.
Three: Obtain the actual value of the text0 widget in the data entry cell in a report.
Four: Obtain the actual value of the text0 widget in the body page of a dashboard.
Five: Obtain the actual value of the text0 widget component in an FVS dashboard template. duchamp.getWidgetByName("text0").getValue(); Note: In the FVS Dashboard Edit Mode plugin V1.16.0 and later versions, the title component also supports the getValue() interface, which has the same usage as Example Five. | |
Application Example | Obtain the value of the date widget. When the interval between the start time and end time is more than 30 days, a prompt box pops up as shown in the following figure. | |
Mobile Terminal | It is supported on mobile terminals. |
getText
Method | getText() | Obtains the display value of widgets. |
Parameter | / | / |
Return Value | string | |
Example | One: If the obtained widget object is defined as widget, obtain the display value of the widget.
Two: Obtain the display value of the text0 widget on the parameter panel.
Three: Obtain the display value of the text0 widget in the data entry cell in a report.
Four: Obtain the display value of the text0 widget in the body page of a dashboard.
Five: Obtain the display value of the text0 widget component in an FVS dashboard template.
| |
Application Example | After a value is selected from the drop-down box, print its actual value and display value. Click to download the template: Obtain Widget Display Value.cpt | |
Mobile Terminal | It is supported on mobile terminals. |
setValue
Method | setValue(value) | Sets the value of widgets. |
Parameter | value: any | Widget value in any format |
Return Value | void | |
Example | One: If the obtained widget object is defined as widget, set the widget value to Text.
Two: Obtain the text0 widget on the parameter panel and set the widget value to Text.
Three: Obtain the text0 widget in the data entry cell in a report and set the widget value to Text.
Four: Obtain the text0 widget in the body page of a dashboard and set the widget value to Text.
Five: Assign multiple values to the drop-down checkbox on the parameter panel in an ordinary report.
Six: Obtain the text0 widget component in the FVS dashboard template and set the widget value to Text. duchamp.getWidgetByName("text0").setValue('Text'); | |
Application Example | Click different buttons to set different values for date widgets. | |
Mobile Terminal | It is supported on mobile terminals. |
visible
Method | visible() | Sets widgets visible. |
Parameter | / | / |
Return Value | void | |
Example | One: If the obtained widget object is defined as widget, set the widget visible. widget.visible(); Two: Obtain the text0 widget on the parameter panel and set the widget visible.
Three: Obtain the text0 widget in the data entry cell in a report and set the widget visible.
Four: Obtain the text0 widget in the body page of a dashboard and set the widget visible. _g().getWidgetByName("text0").getValue(); | |
Application Example | Click the button to display some widgets on the parameter panel. Click to download the template: Set Widget Visible.cpt | |
Mobile Terminal | It is supported on mobile terminals, but not supported in FVS dashboard templates. |
invisible
Method | invisible() | Sets widgets invisible. |
Parameter | / | / |
Return Value | void | |
Example | One: If the obtained widget object is defined as widget, set the widget invisible.
Two: Obtain the text0 widget on the parameter panel and set the widget invisible.
Three: Obtain the text0 widget in the data entry cell in a report and set the widget invisible.
Four: Obtain the text0 widget in the body page of a dashboard and set the widget invisible. _g().getWidgetByName("text0").invisible(); | |
Application Example | Click the button to hide some widgets on the parameter panel. Click to download the template: Set Widget Invisible.cpt | |
Mobile Terminal | It is supported on mobile terminals, but not supported in FVS dashboard templates. |
setVisible
Method | setVisible(visibility) | Sets widgets visible/invisible. |
Parameter | visibility: boolean | Whether it is visible or not (Boolean)
|
Return Value | void | |
Example | One: If the obtained widget object is defined as widget, set the widget invisible.
Two: Obtain the text0 widget on the parameter panel and set the widget invisible.
Three: Obtain the text0 widget in the data entry cell in a report and set the widget invisible.
Four: Obtain the text0 widget in the body page of a dashboard and set the widget invisible.
Five: Obtain the text0 widget component in an FVS dashboard template and set the widget invisible. duchamp.getWidgetByName("text0").setVisible(false); | |
Application Example | Only after the content is selected in the previous drop-down box, the subsequent drop-down box is displayed as shown in the following figure. | |
Mobile Terminal | It is partly supported on mobile terminals, but not supported for the widgets in the data entry cell in a report. |
isVisible
Method | isVisible() | Whether the widget is visible or not |
Parameter | / | / |
Return Value | boolean | Whether it is visible or not (Boolean)
|
Example | One: If the obtained widget object is defined as widget, return that the widget is visible/invisible.
Two: Obtain the text0 widget on the parameter panel and return that the widget is visible/invisible.
Three: Obtain the text0 widget in the data entry cell in a report and return that the widget is visible/invisible.
Four: Obtain the text0 widget in the body page of a dashboard and return that the widget is visible/invisible.
Five: Obtain the text0 widget component in an FVS dashboard template and return that the widget is visible/invisible. duchamp.getWidgetByName("text0").isVisible(); | |
Application Example | After a city in the widget is selected, the query button is displayed. Otherwise, the query button is not displayed. Click to download the template: Widget Visible or Not.cpt | |
Mobile Terminal | It is partly supported on mobile terminals, but not supported for the widgets in the data entry cell in a report. |
setEnable
Method | setEnable(enabled) | Sets widgets enabled/disabled. |
Parameter | enabled: boolean | Whether it is enabled or not (Boolean)
|
Return Value | void | |
Example | One: If the obtained widget object is defined as widget, set the widget disabled.
Two: Obtain the text0 widget on the parameter panel and set the widget disabled.
Three: Obtain the text0 widget in the data entry cell in a report and set the widget disabled.
Four: Obtain the text0 widget in the body page of a dashboard and set the widget disabled.
Five: Obtain the text0 widget component in an FVS dashboard template and set the widget disabled. duchamp.getWidgetByName("text0").setEnable(false); | |
Application Example | The position can only be selected once. After selection, the widget would become disabled. Click to download the template: setEnable.cpt | |
Mobile Terminal | It is partly supported on mobile terminals, but not supported for the widgets in the data entry cell in a report. |
isEnabled
Method | isEnabled() | Whether the widget is enabled or not |
Parameter | / | / |
Return Value | boolean | Whether it is enabled or not (Boolean)
|
Example | One: If the obtained widget object is defined as widget, return that the widget is enabled/disabled.
Two: Obtain the text0 widget on the parameter panel and return that the widget is enabled/disabled.
Three: Obtain the text0 widget in the data entry cell in a report and return that the widget is enabled/disabled.
Four: Obtain the text0 widget in the body page of a dashboard and return that the widget is enabled/disabled.
Five: Obtain the text0 widget component in an FVS dashboard template and return that the widget is enabled/disabled. duchamp.getWidgetByName("text0").isEnabled(); | |
Application Example | After a city in the widget is selected, the query button is enabled. Otherwise, the query button is disabled. Click to download the template: Widget Enabled or Not.cpt | |
Mobile Terminal | It is partly supported on mobile terminals, but not supported for the widgets in the data entry cell in a report. |
reset
Method | reset() | Clears widget content to reset it. |
Parameter | / | / |
Return Value | void | |
Example | One: If the obtained widget object is defined as widget, clear the widget content.
Two: Obtain the text0 widget on the parameter panel and clear the widget content.
Three: Obtain the text0 widget in the data entry cell in a report and clear the widget content.
Four: Obtain the text0 widget in the body page of a dashboard and clear the widget content.
Five: Obtain the text0 widget component in an FVS dashboard template and clear the widget content. duchamp.getWidgetByName("text0").reset(); | |
Application Example | Click the button to clear all widget values. Click to download the template: Reset the Widget Value.cpt | |
Mobile Terminal | It is supported on mobile terminals. |
getType
Method | getType() | Obtains the widget type. |
Parameter | / | / |
Return Value | string | Returns the default widget type, such as button for button and drop-down box for comboBox. |
Example | One: If the obtained widget object is defined as widget, return the widget type.
Two: Obtain the text0 widget on the parameter panel and return the widget type.
Three: Obtain the text0 widget in the data entry cell in a report and return the widget type.
Four: Obtain the text0 widget in the body page of a dashboard and return the widget type. _g().getWidgetByName("text0").getType(); | |
Application Example | Click the button to obtain the widget type. Click to download the template: View Widget Type.cpt | |
Mobile Terminal | It is supported on mobile terminals, but not supported in FVS dashboard templates. |
setWaterMark
Method | setWaterMark(text) | Adds watermark text (only support widgets with input boxes). |
Param ter | text: string | Watermark text |
Return Value | void | |
Exam ple | One: If the obtained widget object is defined as widget, add the watermark "Enter the name" to the widget.
Two: Obtain the text0 widget on the parameter panel and add the watermark "Enter the name" to the widget.
Three: Obtain the text0 widget in the data entry cell in a report and add the watermark "Enter the name" to the widget.
Four: Obtain the text0 widget in the body page of a dashboard and add the watermark "Enter the name" to the widget. _g().getWidgetByName("text0").setWaterMark('Enter the name'); Note: After adding an event, you can add a delay function to delay the execution in case of an error due to incomplete creation of the report block object.
Five: Obtain the text0 widget component in an FVS dashboard template and add the watermark "Enter the name" to the widget.
| |
Applica tion Exam ple | Add watermark to the text box widget as shown in the following figure. Click to download the template: Widget Watermark.cpt | |
Mobile Terminal | It is supported on mobile terminals. |
fireEvent
Method | fireEvent(eventName); | Calls widget events. |
Parameter | eventName: string | For details about values, see Widget Event. For example, the After Initialization event is afterinit. |
Return Value | void | |
Example | One: If the obtained widget object is defined as widget, trigger the After Initialization event of the widget.
Two: Obtain the text0 widget on the parameter panel and trigger the After Initialization event of the widget.
Three: Obtain the text0 widget in the data entry cell in a report and trigger the After Initialization event of the widget.
Four: Obtain the text0 widget in the body page of a dashboard and trigger the After Initialization event of the widget. _g().getWidgetByName("text0").fireEvent('afterinit'); | |
Application Example | In a dashboard, click the button to assign a value to the date widget, and trigger the After Editing event of the date widget to submit parameter query simultaneously. | |
Mobile Terminal | It is supported on mobile terminals, but not supported in FVS dashboard templates. |
setPopupStyle
Method | setPopupStyle(PopupStyle) | Sets the style of the drop-down box widgets, such as drop-down box and drop-down checkbox. |
Parameter | PopupStyle:{ itemHeight: string; fontSize: string; } | PopupStyle: Pop-uping the box style, JSON format itemHeight: Height of the options in the pop-up box fontSize: Font size in the pop-up box |
Return Value | void | |
Example | One: If the obtained drop-down box widget object is defined as widget, set the height of drop-down options in the widget to 30px and font size to 20px.
Two: Obtain the text0 widget on the parameter panel and set the height of drop-down options in the widget to 30px and font size to 20px.
Three: Obtain the text0 widget in the data entry cell in a report and set the height of drop-down options in the widget to 30px and font size to 20px.
Four: Obtain the text0 widget in the body page of a dashboard and set the height of drop-down options in the widget to 30px and font size to 20px.
Note: After adding an event, you can add a delay function to delay the execution in case of an error due to incomplete creation of the report block object.
| |
Application Example | Set the height of drop-down options in the widget to 30px and font size to 20px. Click to download the template: Widget Style.cpt | |
Mobile Terminal | It is not supported on mobile terminals. |
return false
Method | / | Add return false in the event to block the subsequent execution. For example, add an event to the query button to prevent it from querying. |
Parameter | / | / |
Return Value | / | |
Example | Add an After Editing event to the drop-down checkbox widget for a dashboard, with the event content shown as below.
| |
Application Example | Add a blocking event to the query button. When the region is selected as Indonesia, the query fails. While the region is selected as Malaysia, the query succeeds. Click to download the template: Selective Query.cpt | |
Mobile Terminal | In Report Server V11.0.11 as well as App\HTML5 V11.0.76 and later versions, mobile terminals support the use of the return false interface, but do not support the function of preventing triggering linkage, such as preventing the default query after a value is selected in the widget in the body page of a dashboard. |