Widget Event

  • Last update:  2020-12-14
  • I. Overview

    According to the response time of the widget, we divide the events of the widget into nine types: after initialization, before editing, after editing, editing end, click, state change, value change, after upload and node generation.

    II. Event types supported by widgets

    The details of event types supported by various widgets are as follows:

    Note: There is no label widget under the data entry page.

    widget/event

    afterinit

    before

    edit

    after

    edit

    stopedit

    click

    state

    change

    value

    change

    call

    back

    node

    add

    text

      √

      √

      √

      √






    label

      √




      √


      √



    Button

      √




      √





    Drop down box

      √

      √

      √

      √

      √





    Drop-down checkbox

      √

      √

      √

      √

      √





    date

      √


      √

      √






    number

      √

      √

      √

      √






    Drop down tree

      √

      √

      √

      √

      √




     √

    Radio button group

      √





      √




    Checkbox group

      √





      √




    Text field

      √

     √

     √

     √






    password

      √

     √

     √

     √






    Checkbox

     √





     √




    View tree

     √




     √




     √

    List

     √




     √





    file

     √







     √


    III. Mechanism of event trigger

    The FineReport widget is only allowed to be used in data entry reports, in the parameter pane, and in dashboards, so the widgets are divided into data entry widget and dashboard widget. Due to the difference between these, the triggering time of widget events is different, as described below:

    • After initialization : the initialization event of dashboards is triggered after the widget loads. Check box widget, radio button group widgets, Checkbox group and view the tree widget initialization event is triggered when the widget finishes loading, others are triggered when the when the cell is clicked when in data entry; please refer to the batch delete for examples of initialization events . 

    • Before editing : triggered when the widget is edited.

    • After editing : Triggered after the widget is edited. If the alert prompt is used in the event, please use the toast prompt instead, otherwise it will affect the Chinese input; please see the dynamic display parameter widget for the event example of after editing . 

    • Editing end : Triggered when the focus leaves the widget; for an example of the editing end event, please see Setting the number for the extended cell . 

    • Click : The click events of the drop-down box, drop-down check box, and drop-down tree are triggered when the drop-down item is clicked, and other widgets are triggered when the widget is clicked; please refer to the batch delete for examples of click events .

    • State change : State change event is triggered when the value of the widget changes. This event can only be applied to check boxes, radio button groups and check box groups. For an example of a state change event, please see the input value in the dialog box that pops up by clicking the radio button . 

    Note:

    • In the data entry report and the edit end event is set for the report widget, when the cursor is in the widget without any changes, and then exit editing, the edit end event will not be triggered at this time. But it will be triggered in dashboard widgets. If you want it in the data entry report the same as in the dashboard, you can add an after initialization event for this widget:

    contentPane.setFireStopEditOnChange(false);
    • The built-in submission cannot be used in the after editing event, because the built-in submission event will trigger the after editing event, and the after editing event will trigger the submission event, which will cause an endless loop.

    IV. How to use JS in widget events

    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