Blank cells after hide

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

Blank cells after hide

#1

Postby edwinayin@qq.com » Thu Dec 15, 2016 5:42 pm

Hello,

I created a button to hide/show certain grid cells using the following code (thanks to Dave's suggestion on the other post about modifier):

Code: Select all

var page = pages.PAGE_1;

if(//condition){
		for each (var ctrl in page.getControlsByModifier("old_version")){
			ctrl.all.setHidden(false);
		} 

}
	else if(//condition){
		for each (var ctrl in page.getControlsByModifier("old_version")){
			ctrl.all.setHidden(true);
		} 
		
	}
The button works great, but I tried to hide the related grid cells ('old_version'),I put

Code: Select all

for each (var ctrl in page.getControlsByModifier("old_version")){
			ctrl.all.setHidden(true);
		} 
in my BP script, the content did disappear, but I got the empty grid cells.

Any suggestions?

Thanks in advance!!

Edwina[/code]
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#2

Postby Segi » Thu Dec 15, 2016 5:53 pm

Hi,

I just did something that I think is the same thing that you are trying to do.

I had a grid with 1 column and 3 grid rows. In the before page event, I loop through all rows of the repeater which contains this grid and if a certain situation is true, I want to hide the 3rd row of the grid. I accomplished this by giving the controls' grid row a unique control name like GRIDROW3 and hide it by setting the CSS on that control:

controls.GRIDROW3.setStyle("display: none !important");

That will hide the 3rd row of the grid

so change

Code: Select all

ctrl.all.setHidden(true); 
to

Code: Select all

ctrl.all.setStyle("display: none !important");
Keep in mind that using the .all propery affects the entire control.
0 x

edwinayin@qq.com
Ebase User
Posts: 24
Joined: Fri Nov 04, 2016 7:41 pm

#3

Postby edwinayin@qq.com » Thu Dec 15, 2016 6:00 pm

Thank you so much Seji,

I replaced

Code: Select all

ctrl.all.setHidden(true); 
with

Code: Select all

ctrl.all.setStyle("display: none !important"); 
And it worked!!!

Thanks!!
0 x


Who is online

Users browsing this forum: No registered users and 54 guests