JS Traverse Report Objects

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

    FineReport reports use jQuery framework, so you can use each method of jQuery in a template to traverse all report objects and apply unified operations to each object.

    II. Instructions

    Use $.each(objects,function(i,item){...}); to traverse objects and apply the function on each object.

    Each time the function is executed, two parameters are passed: i and item. i represents the position of the current object in the entire object collection (i starts from 0), and item is the object itself.

    For example, the code in Reset the Widget Value traverse the widgets in the parameter pane and then reset the value of each widget:

    $.each(this.options.form.name_widgets,function(i,item)
    {item.reset()});

    During the traversal, if the function returns 'false', the loop is terminated (just like using 'break' in a normal loop). If the function returns 'true', it will skip to the next loop (just like using 'continue' in a normal loop).

    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