Widget Object

  • Last update:December 14, 2020
  • I. Overview

    In order to control whether the widget is visible, set widget events, etc., it is usually necessary to obtain the widget object. In the parameter pane of cpt and frm, the data entry page of cpt and the body of frm, you can get widget objects.

    II. Get widget object

    For the parameter pane of cpt and frm, the methods are the same:

    var Widget = this.options.form.getWidgetByName("WidgetName");

    For the data entry of cpt, contentPane must be obtained first:

    var Widget = contentPane.getWidgetByName("WidgetName");

    III. Common methods of widget

    Method name
    MethodDescription

    Get Value

    Widget.getValue()

    Get widget value

    Get Value

    Widget.getText()

    Get display value

    Assign Value

    Widget.setValue()

    Assign values to parameter widget, it is not recommended to assign values to the data entry widget

    Reset

    Widget.reset() 

    Clear data

    visible

    Widget.visible()

    Set the widget to be visible

    Invisible

    Widget.invisible()

    Set the widget to be not visible

    Visible or not

    Widget.isvisible()

    Visible returns true, invisible returns false

    Set visible

    Widget.setVisible(boolean)

    Set the widget to be visible, true is visible, false is invisible

    Set enabled

    Widget.setEnable(boolean)

    Set the widget to be available, true is available, false is not available

    Enabled or not

    Widget.isEnabled()

    Return true if available, false if not available

    Call widget event

    Widget.fireEvent("Event Name")

    Set the widget to trigger an event with the specified name

    Note:

    • If the js is in the current widget, you can directly use this instead of obtaining current widget, such as this.getValue().

    • The reason why it is not recommended to use Widget.setValue() to assign a value to the data entry cell, is that the value is assigned to the widget and will be cleared before the widget passes to the cell. So it is recommended to use setCellValue() to assign a value to the data entry cell.


    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