Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Trying to copy table row from one table to another using button.

Avatar

Avatar
Level 1
martynd54407871
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
martynd54407871
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
martynd54407871
Level 1

13-12-2017

I have two dynamic tables. Table 1 contains a list of to do items and  I want to move items completed to another table (Table 2) using a button that is incorporated into the table.

I have broken the task down into three sections:

1.     add a new row to Table 2 - this is working

2.     copy or move the appropriate row to the new table - NOT WORKING

3.     delete the old (now empty row) from Table 1 - not got to this yet.

Here is the script from the Click event:

          form1.Pg1.Table1.Row1.Btn_Completed::click - (JavaScript, client)

          //Step 1 Add a line to Table 2

          this.resolveNode('Pg2.Table2._Row1').addInstance(); //this works 12/13/17 14:45

          Pg2.Table2.Row1.itemDescription.rawValue = form1.Pg1.Table1.Row1.itemDescription.rawValue;

I have got it working somewhat but it only copies the first row. Any help greatly appreciated!

till a bit of a newbie at this. Using LC ES4

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

14-12-2017

Hi,

You need to reference the correct instance in the table.

Even though the table will physically have two rows when you look at it, the second row will be an instance of Row1. It is still called Row1 but with the instance specified.

The first repeating row instance will be - form1.Pg1.Table1.Row1[0].itemDescription.rawValue

then

form1.Pg1.Table1.Row1[1].itemDescription.rawValue //row 2

form1.Pg1.Table1.Row1[2].itemDescription.rawValue //row 3

and so on

I have highlighted the difference above. The same can be used when deleting a specific row.