JS Insert Customized Number of Rows

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

    1.1 Requirement

    In many cases, by clicking [Insert Row], only one row will be inserted. How to customize the number of rows and how to insert a specified number of rows? JavaScript will enable you to achieve the effect below:

     

     

    1.2 Solution

    Add a Click event to the Button widget and insert rows using the following function in JavaScript: appendReportRow().

    II. Sample

    2.1 Template settings

    Configure settings for the template as follows and set [Vertical Expansion] for A3.

    Add a Button widget to G3 and configure settings for it as follows: 

     

    2.2 Add a Click event

    Add a Click event to the Button widget, as shown in the figure below:

     

    Input the following JavaScript codes:

    num = prompt("The number of rows to be inserted: ","");
    _g().appendReportRow(this.options.location, this.options.reportIndex,num)


    2.3 Preview

    Save the template and click [Data Entry Preview]. The preview effect on a PC is shown as below:

    III. Download the template

    Attachment List


    Theme: Data Entry
    Already the First
    Already the Last
    • 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