Successfully!

Error!

You are viewing 10.0 help doc. More details are displayed in the latest help doc

JS Implementation Only Submits Modified Data

I. Overview

1. Problem description

In No modify,no updateThe document introduces the functions and limitations of unmodified and non-updated. One of the limitations is: Unmodified and non-updated is only applicable to the case where all the entered values are cells. If the entered values are fixed strings, formulas, parameters, etc. Form, the function will be grayed out and cannot be used. So how to circumvent this restriction?

1.png


2. Solutions

You can use setting submission conditions to cleverly avoid this restriction, mark the modified/inserted/deleted row, and then use the submission conditions to indirectly realize the No modify,no update function. This function is more versatile than the above.

Note: Mobile terminal and Excel import scenes are not supported

II. Operation steps

1. Template preparation

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


2. Set the text widget

Select cell L3, click Widget Settings in the property panel on the right, and select the Text Field, as shown in the figure below:

2.png


3. Modify field value

Click Template> Data Entry Attribute, and change the value of the "Abort" field to false, as shown in the following figure:

3.png


4. Set submission conditions

Click Set submission conditions, select the formula, the formula is L3=1, and click OK. As shown below:

4.png


5. Add mark

Write JS code in the After editing event of the cell widget that may involve modifying the content. For example, select cell B3, and click Widget Settings>Event>After editing in the property panel on the right to set the marker 1. As shown below:

5.png

The JavaScript code is as follows:

contentPane.curLGP.setCellValue('L'+row,null,1);
contentPane.setCellValue('L'+row,null,1);


6. Add a mark when adding a new line

You don't need to set it, because after adding a new cell, editing the cell will also call the code in Chapter II.5.


7. Mark when deleting rows

Open Template>Web Attributes>Data Entry settings and add a Delete before rowevent. The difference here is to get the row number, as shown in the following figure:

6.png

The JS code is as follows:

var row=parseInt($(contentPane.curLGP.currentTDCell).attr('row'))+1;
contentPane.curLGP.setCellValue('L'+row,null,1); 
contentPane.setCellValue('L'+row,null,1);


8. Effect view

After saving, click to Data Entry Preview, try to modify, add, and delete respectively, you can see the effect.

2021-12-30_13-23-15.gif

III. Template download

Click to download the template:

Lift the Restriction of Unmodified, Non-updated And Unavailable.cpt

Template location : %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\DataEntry\Lift the Restriction of Unmodified, Non-updated And Unavailable.cpt

Attachment List


Theme: Data Entry
Already the First
Already the Last
  • Helpful
  • Not helpful
  • Only read

Doc Feedback