How to hide dynamic table row according to a field

Avatar

Avatar
Validate 1
Level 1
KareemGaber
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
KareemGaber
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile
KareemGaber
Level 1

09-02-2020

I'm trying to hide rows according to value of text but it only works on the first row.

MaterialInspection.layout.Table1.Row1.InspectionResult.rawValue = MaterialInspection.layout.Table1.Row1.Print.rawValue;

if(MaterialInspection.layout.Table1.Row1.Print.rawValue == "false") 
{ 
this.presence = "hidden"; 
} 
else if(MaterialInspection.layout.Table1.Row1.Print.rawValue == "true") 
{ 
this.presence = "visible"; 
}

I tried the above code in initialize events of each of Table1 and Row1, I also tried it in index change event of Row1, if the value of the first row is false all the rows gets hidden and if the value of the first row is true then all the rows gets visible, what am I doing wrong?.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 1
KareemGaber
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
KareemGaber
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile
KareemGaber
Level 1

09-02-2020

I managed to do it in the index change event like that:

this.InspectionResult.rawValue = this.Print.rawValue;

if(this.Print.rawValue == "false") 
{ 
this.presence = "hidden"; 
} 
else if(this.Print.rawValue == "true") 
{ 
this.presence = "visible"; 
}

Answers (1)

Answers (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

11-02-2020

In case the value of the field can be changed by a script or user action, your solution won't work, since it fires just once per row, when it's going to be created the first time. To make it work use the following script in the calculate event of the row. 

 

this.presence ? Print.rawValue === true ? "visible" : "hidden";