Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Lock a particular cell on every row of a table

Avatar

Level 2

I have a single Table ("TableA") with 4 rows - all named "Row". Thus...Row[0], Row[1], Row[2], and Row[3].


Each row has 3 cells.

What I'm trying to do is lock the 2nd cell ("Cell2") on every row - essentially locking an entire column.

I tried using the following script on a button, but it doesn't work.

TableA.Row[*].Cell2.access = "protected";

Any ideas?

Thanks in advance!

Tony

1 Accepted Solution

Avatar

Correct answer by
Level 2

I figured it out using a loop statement...

Will leave this posted just in case it helps someone else in the future!

var rows = xfa.resolveNodes("TableA.Row[*].Cell2");

    for (var i = 0; i < rows.length; i++)

    {

                var lockField = rows.item(i);

        lockField.access = "protected";

    }

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

I figured it out using a loop statement...

Will leave this posted just in case it helps someone else in the future!

var rows = xfa.resolveNodes("TableA.Row[*].Cell2");

    for (var i = 0; i < rows.length; i++)

    {

                var lockField = rows.item(i);

        lockField.access = "protected";

    }