JS 新たに挿入する行数を設定

  • 作成者:ayuan0625
  • 編集回数:10次
  • 最終更新:ayuan0625 于 2020-12-15
  • 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: FineReport カスタム開発
    • いいね
    • 良くない
    • 閲覧しただけ