Expand my Community achievements bar.

Conditional statments in tables

Avatar

Level 1

Hi ,

Can anyone help me with a problem relating to dynamic tables and conditional statements.

I have a dynamic table where the user can add and delete rows as required – which appends the array value in square brackets to the duplicated row.

Within a row I want to display a cash value in say  the 3rd column dependent on the value previously selected from a drop down in 2nd column.

I’m struggling to understand the simplest way of referring to the rows previous column in a conditional statement.

Any help would be appreciated.

Dog.

1 Reply

Avatar

Level 2

Hi Dog,

There are a couple of ways to do it, probably easiest is to take advantage of the fact that the 2 fields are in the same row and therefore share a parent. You could put this script in the ready:layout event of the target field.

     // Refer to data in previous column
     if (this.parent.DropDownField != null) {
          this.rawValue = this.parent.DropDownField.rawValue;
     }

Where:

this = the target field (i.e. the field where you want the value displayed)

this.parent = the current row of the table

DropDownField = is the field in the previous column, replace this with the name of your field