getValue
| Method | getValue() | Get the actual value of the widget |
|---|---|---|
| Parameter | - | - |
| Return value | any | |
| Example | Example 1: If the obtained widget object is defined as widget, get the actual value of the widget Example 2: Get the actual value of the text0 widget on the parameter pane Example 3: Obtain the actual value of the text0 widget in the data entry cell in a general report Example 4: Get the actual value of the text0 widget in the body in the dashboard _g().getWidgetByName("text0").getValue(); | |
Applicaiton example | Get the value of the date widget, when the difference between the start time and the end time is greater than 30 days, a pop-up reminder: For detailed implementation methods, please refer to: JS implements date widget query days control
| |
| Mobile | Support mobile terminal | |
getText
| Method | getText() | Get the display value of the widget |
|---|---|---|
| Parameter | - | - |
| Return value | string | |
| Example | Example 1: If the obtained widget object is defined as widget, get the display value of the widget Example 2: Get the display value of the text0 widget on the parameter pane Example 3: Obtain the display value of the text0 widget in the data entry cell in a general report Example 4: Obtain the display value of the text0 widget in the body in the dashboard _g().getWidgetByName("text0").getText(); | |
Application example | After selecting a value from the drop-down box, print its actual and displayed values: Click to download the template: Obtain widget displayed value.cpt
| |
| Mobile | Suuport mobile terminal | |
setValue
| Method | setValue(value) | Set the value of the widget |
|---|---|---|
| Parameter | value: any | Widget value, any format |
| Return value | void | |
| Example | Example 1: If the obtained widget object is defined as widget, set the value of the widget to "text" Example 2: Get the widget text0 on the parameter pane and set its widget value to "text" Example 3: Get the text0 widget in the data entry cell in a general report, and set its widget value to "text" Example 4: Get the text0 widget in the body in the dashboard, and set its widget value to "text" _g().getWidgetByName("text0").setValue('text'); | |
Application example | Click the button and set the appropriate value for the date widget: For detailed implementation methods, please refer to: JS Custom Buttons Assign Specified Range Values
| |
| Mobile | Support mobile terminal | |
visible
| Method | visible() | Set widget visible |
|---|---|---|
| Parameter | - | - |
| Return value | void | |
| Example | Example 1: If the obtained widget object is defined as widget, set it to be visible Example 2: Get the widget text0 on the parameter pane and set it to be visible Example 3: Get the text0 widget in the data entry cell in a general report and set it to be visible Example 4: Get the text0 widget in the body in the dashboard and set it to be visible _g().getWidgetByName("text0").visible(); | |
Application example | Click the button to display some of the widgets in the parameter pane: Click to download the template:
| |
| Mobile | Support mobile terminal | |
invisible
| Method | invisible() | Set widget invisible |
|---|---|---|
| Parameter | - | - |
| Return value | void | |
| Example | Example 1: If the obtained widget object is defined as widget, set it to be invisible Example 2: Get the widget text0 on the parameter pane and set it to be invisible Example 3: Get the text0 widget in the data entry cell in a general report and set it to be invisible Example 4: Get the text0 widget in the body in the dashboard and set it to be invisible _g().getWidgetByName("text0").visible(); | |
Application example | Click the button to hide some of the widgets in the parameter pane: Click to download the template:
| |
| Mobile | Support mobile terminal | |
setVisible
| Method | setVisible(visibility) | Set widget visible/invisible |
|---|---|---|
| Parameter | visibility: boolean | Whether visible,boolean
|
| Return value | void | |
| Example | Example 1: If the obtained widget object is defined as widget, set it to be invisible Example 2: Get the widget text0 on the parameter pane and set it to be invisible Example 3: Get the text0 widget in the data entry cell in a general report and set it to be invisible Example 4: Get the text0 widget in the body in the dashboard and set it to be invisible _g().getWidgetByName("text0").setVisible(false); | |
Application example | Only after the content of the previous drop-down box is selected, the next layer of drop-down box widget is displayed: For detailed implementation methods, please refer to: JS Control whether the Parameter Widget is Displayed
| |
| Mobile | Support mobile terminal | |
isVisible
| Method | isVisible() | Whether the widget is visible |
|---|---|---|
| Parameter | - | - |
| Return value | boolean | Whether visible, boolean
|
| Example | Example 1: If the obtained widget object is defined as widget, return whether it is visible Example 2: Get the cwidget text0 on the parameter pane and return whether it is visible Example 3: Get the text0 widget in the data entry cell in a general report, and return whether it is visible Example 4: Get the text0 widget in the body in the dashboard and return whether it is visible _g().getWidgetByName("text0").isVisible(); | |
Application example | After the province widget selects the value, the query button is visible; otherwise, the query button is invisible: Click to download the template:
| |
| Mobile | Support mobile terminal | |
setEnable
| Method | setEnable(enabled) | Set widget enabled/disabled |
|---|---|---|
| Parameter | enabled: boolean | Whether enabled, boolean true:enabled false:disabled |
| Return value | void | |
| Example | Example 1: If the obtained widget object is defined as widget, set it to be disabled Example 2: Get the widget text0 on the parameter pane and set it to be disabled Example 3: Get the text0 widget in the data entry cell in a general report and set it to be disabled Example 4: Get the text0 widget in the body in the dashboard and set it to be disabled _g().getWidgetByName("text0").setEnable(false); | |
Application example | Grades can only be selected once, and once selected makes the widget disabled: For the detailed implementation method, please refer to: JS implements the data entry widget can only fill in once
| |
| Mobile | Support mobile terminal | |
isEnabled
| Method | isEnabled() | Whether the widget is enabled |
|---|---|---|
| Parameter | - | - |
| Return value | boolean | Whether enabled, boolean
|
| Example | Example 1: If the obtained widget object is defined as widget, return whether it is enabled Example 2: Get the cwidget text0 on the parameter pane and return whether it is enabled Example 3: Get the text0 widget in the data entry cell in a general report, and return whether it is enabled Example 4: Get the text0 widget in the body in the dashboard and return whether it is enabled _g().getWidgetByName("text0").isVisible(); | |
Application example | After the province widget selects the value, the query button is enbaled; otherwise, the query button is not enabled: Click to download the template:
| |
| Mobile | Support mobile terminal | |
reset
| Method | reset() | Reset the widget, clear the content of the widget |
|---|---|---|
| Parameter | - | - |
| Return value | void | |
| Example | Example 1: If the obtained widget object is defined as widget, clear the content of the widget: Example 2: Get the widget text0 on the parameter pane and clear the content of the widget: Example 3: Get the text0 widget in the data entry cell in a general report, and clear the content of the widget: Example 4: Get the text0 widget in the body in the dashboard, and clear the content of the widget: _g().getWidgetByName("text0").reset(); | |
Application example | Click the button to clear all widget values: For the detailed implementation method, please refer to: JS Reset the Widget Value
| |
| Mobile | Support mobile terminal | |
getType
| Method | getType() | Get widget type |
|---|---|---|
| Parameter | - | - |
| Return value | string | String, returns the default widget name type, such as button for button, comboBox for drop-down box |
| Example | Example 1: If the obtained widget object is defined as widget, return its type Example 2: Get the cwidget text0 on the parameter pane and return its type Example 3: Get the text0 widget in the data entry cell in a general report and return its type Example 4: Get the text0 widget in the body in the dashboard and return its type _g().getWidgetByName("text0").getType(); | |
Application example | Click the button to get the widget type: Click to download the template:
| |
| Mobile | Support mobile terminal | |
setWaterMark
| Method | setWaterMark(text) | Add watermark text (only supports widgets with input boxes) |
|---|---|---|
| Parameter | text: string | Watermark text, string |
| Return value | void | |
| Example | Example 1: If the obtained widget object is defined as widget, add a watermark of "Please enter your name" to it Example 2: Get the widget text0 on the parameter pane and add a watermark of "Please enter your name" to it Example 3: Obtain the text0 widget in the data entry cell in a general report, and add a watermark of "Please enter your name" to it Example 4: Obtain the text0 widget in the body of the dashboard, and add a watermark of "Please enter your name" to it Note: After adding an event, after an error is reported because the report block object is not completely created, you can add a delay function to delay execution, such as: | |
Application example | Add a watermark to the textbox widget: Click to download the template:
| |
| Mobile | Support mobile terminal | |
fireEvent
| Method | fireEvent(eventName); | Call widget event |
|---|---|---|
| Parameter | eventName: string | Event type, string, value can refer to: widget event, such as "after initialization" event is afterinit |
| Return value | void | |
| Example | Example 1: If the obtained widget object is defined as widget, trigger the "after initialization" event of the widget Example 2: Get the widget text0 on the parameter pane and trigger its "after initialization" event Example 3: Obtain the text0 widget in the data entry cell in a general report, and trigger its "after initialization" event Example 4: Get the text0 widget in the body in the dashboard and trigger its "after initialization" event _g().getWidgetByName("text0").fireEvent('afterinit'); | |
| Application example | In the dashboard, click the button to assign a value to the date widget, and at the same time trigger the "after editing" event of the date widget to submit a parameter query: For detailed implementation methods, please refer to: Dashboard button queries the data of the latest date
| |
| Mobile | Support mobile terminal | |
setPopupStyle
| Method | setPopupStyle(PopupStyle) | Set the style of the widget drop-down option box. Only widgets with option boxes are supported, such as drop-down boxes and drop-down check boxes. |
|---|---|---|
| Parameter | PopupStyle:{ itemHeight: string; | PopupStyle: Popup style, json format
|
| Return value | void | |
| Example | Example 1: If the obtained drop-down box widget object is defined as widget, set its pop-up box option height to 30px and font size to 20px Example 2: Get the drop-down box widget comboBox0 on the parameter pane, and set its pop-up box option height to 30px and font size to 20px Example 3: Obtain the drop-down box widget comboBox0 in the data entry cell in a general report, and set its pop-up box option height to 30px and font size to 20px Example 4: Obtain the drop-down box widget comboBox0 in the body in the dashboard, and set its pop-up box option height to 30px and font size to 20px Note: After adding an event, after an error is reported because the report block object is not completely created, you can add a delay function to delay execution, such as: | |
Application example | Set the drop-down box option height to 30px and font size to 20px: Click to download the template:
| |
| Mobile | Support mobile terminal | |
return false
| Method | - | Add return false to the specific event of the widget, without triggering linkage and query |
|---|---|---|
| Parameter | - | - |
| Return value | - | |
| Example | Add a "After Edit" event to the drop-down checkbox widget of the dashboard, the content of the event is: return false; | |
Application example | The widget added in the dashboard body will trigger the query action immediately after entering the value:
If you want to click the button to start the query after entering the value, you can add an event to the drop-down box widget to not trigger the query:
Click to download the template: Query is not triggered after selecting a value from the drop-down box.frm | |
| Mobile | Support mobile terminal | |
