Submitting Only the Modified Data by JS

  • Last update:June 23, 2025
  • Overview

    Problem

    The function and limitation of No Modification, No Update are introduced in No Modification, No Update. One of the limitations is that the No Modification, No Update function is only applicable to values of the Cell type. If the entered values are in other formats, such as String, Formula, or Parameter, the function will be grayed out and unavailable. So how to bypass this limitation?

    Solution

    You can use Submission Condition to realize the same effect. To achieve the function of No Modification, No Update indirectly, you can mark the modified/inserted/deleted rows and use a submission condition to submit only the data rows with marks.

    For details about the API description, see JS API Summary.

    iconNote:
    This solution is not supported on mobile terminals or in the scenario of importing Excel data.

    Procedure

    Template Preparation

    Open the template LineForm1.cpt in %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Form\LineForm in the FineReport designer.

    Text Widget Setting

    Select cell L3, click Widget Setting on the right attribute panel, and select Text Widget from the drop-down list of Select Widget. You can hide the column after completing the setting.

    Field Value Modifying

    Choose Template > Data Entry Attribute and modify the value of the Abort field to the string false. In this case, the No Modification, No Update function on the right is grayed out and unavailable, as shown in the following figure.

    Submission Condition Setting

    Click Set Submission Condition, select Formula, enter L3=1 in the Formula box, and click OK, as shown in the following figure.

    Adding Marks to Be Displayed After Modifications

    Add After Editing events to widgets in the cells whose values may be modified, such as cells B3 to K3 in the example.

    The JavaScript code is as follows.

    var row = FR.cellStr2ColumnRow(this.options.location).row + 1;
    //Obtain the index of the current row.
    _g().setCellValue('L' + row, null, 1);
    //Assign a value to the cell in column L of the current row.

    Adding Marks to Be Displayed After Inserting Rows

    This step can be omitted because editing data in cells after inserting a row will still invoke the code from section "Adding Marks to Be Displayed After Modifications."

    Adding Marks to Be Displayed After Deleting Rows

    Choose Template > Web Attribute > Data Entry Setting, and add a Before Row Deletion event. The difference between the code in this section and the above-mentioned code lies in the code for obtaining the row index, as shown in the following figure.

    The JavaScript code is as follows.

    var row = parseInt($(_g().curLGP.currentTDCell).attr('row')) + 1;
    //Obtain the index of the current row that is to be deleted.
    _g().setCellValue('L' + row, null, 1);
    //Assign a value to the cell in column L of the current row that is to be deleted.

    Effect Display

    1. Adding marks to be displayed after modifying or inserting rows

    Click Data Entry Preview and modify a value. In this case, a mark will be added automatically in column L, as shown in the following figure.

    2. Adding marks after deleting rows

    Click Data Entry Preview and click Delete Record. In this case, a mark will be added automatically in column L. Click Submit to delete the data successfully, as shown in the following figure.

    Template Download

    For details, you can download the template Submitting Only the Modified Data by JS.cpt.

    Attachment List


    Theme: Data Entry
    • 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