You are viewing limited content. For full access, please sign in.

Question

Question

How to get ROW INDEX that got changed from a field in a TABLE (Modern Designer Javascript)

asked on May 25

I'm currently designing a Form in the Laserfiche Cloud using the Modern Designer. On that form, I have a Table with some field. When one of the field gets modified (CheckBox field) I'm able to get my Javascript to trigger but only part I'm missis is to capture the ROW number that got triggered .

 

Here is the actual code I have built:

LFForm.onFieldChange(
    function () {
    	//var rowTest1 = event.rowIndex;
        //var rowTest2 = event.options[0].index;
        var row = 3
    	var ProjectName = LFForm.getFieldValues({fieldId: 2, index: row});
		console.log("Row Number = " + row);      
		console.log("Project Name = " + ProjectName);
      
    },
    {fieldId: 6}    // On Change for field "TO BE MODIFIED"
);

 

It's working fine if I pass on manually the ROW Number in variable "row" and I can get the right value from another field on that same row.

Now I just need to get the ROW Number that triggered everything...

1 0

Answer

SELECTED ANSWER
replied on May 25 Show version history

Hi Daniel, make sure the event argument is passed in.

 

  LFForm.onFieldChange(
      function (event) {                          
          var row = event.options[0].index;       
          var ProjectName = LFForm.getFieldValues({ fieldId: 2, index: row });
          console.log("Row Number = " + row);
          console.log("Project Name = " + ProjectName);
      },
      { fieldId: 2 }   
  );

 

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.