API for Getting Component

  • Last update:  2022-02-17
  • getAllWidgets

    MethodgetAllWidgets()Get all the component information in the report object
      Parameter--
    Return value{ [key: string,value:object] }The key is the component name, and the value is the component object
       Example

    View all component information in the report object in the dashboard:

    _g().getAllWidgets();

    Application

    example

    Browser F12 developer tools to view all component information in the dashboard:

    1.png

    MobileSupport mobile terminal

    getWidgetByName

    MethodgetWidgetByName(name)Get a component in the report object, you can get the components in the body and the widgets in the parameter pane
      Parametername: stringcomponent name/widget name,string
    Return valueobject component/widget object,need to be used in conjunction with attributes/methods of components/widgets
       Example

    Note: When the code is added in the "after initialization" event, it is recommended to add a delay function, otherwise an error may occur because the report object is not fully created. An example is as follows:

    setTimeout(function(){
         _g().getWidgetByName("comboBox0");
    }, 500);

    Example 1: In the dashboard, get the drop-down box widget comboBox0 on the parameter pane

    _g().getWidgetByName("comboBox0");

    Example 2: In the dashboard, get the drop-down box widget comboBox0 in the body

    _g().getWidgetByName("comboBox0");

    Example 3: In the dashboard, get the report block report0 in the body

    _g().getWidgetByName("report0");

    Example 4: In a dashboard, get the tab block tabpane0 in the body

    _g().getWidgetByName("tabpane0");

    Application

    example

    Customize a button, get the report block when the button is clicked, and set the report block to be invisible to hide it:

    Click to download the template:

    Hide and Show Component.frm

    2.gif

    MobileSuuport 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