Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Bottom height (sub)form

Questions related to using nuBuilder Forte.
Jannie
Posts: 33
Joined: Sat Jun 09, 2018 4:36 pm
Location: Netherlands
Has thanked: 4 times
Been thanked: 1 time
Contact:

Bottom height (sub)form

Unread post by Jannie »

Today I upgraded to newest nuBuilder4 from version may 2019
After that all my forms have a big bottom margin. It's not possible to reduce it by editing the form.
Does somebody have an easy way to remove this extra margin?
BeforeUpgrade.jpg
AfterUpgrade.jpg
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Bottom height (sub)form

Unread post by kev1n »

Hi,

If you haven't done it: Check the height of each object of subform.
Jannie
Posts: 33
Joined: Sat Jun 09, 2018 4:36 pm
Location: Netherlands
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Bottom height (sub)form

Unread post by Jannie »

Thank you for your reply. I already checked and searched further for reason.
I have found: Same problem is with all my subforms which have form-type 'Form'. All those forms have a minimal height as shown. Subforms with type 'grid' are OK

When looking in development mode of my browser, I see that element height is increased in inline style of form. No padding found.
Same issue with a brand new (empty) nubuilder-database on which I tested by creating two tables with persons/addresses
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Bottom height (sub)form

Unread post by kev1n »

Let me check if the same behavior occurs on my end. I'll get back to you.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Bottom height (sub)form

Unread post by kev1n »

I compared an old version of nuform.php with the current one and noticed that in the current version, the height of the form is increased by 60. That's why you see this gap.

Code: Select all

$edit		= ['height'=>$h + 60,  'width'=> $w];

Code: Select all

$edit		= ['height'=>$h,  'width'=> $w];
https://github.com/steven-copley/nubuil ... .php#L1352

If this + 60 is removed, the gap will be gone.
Jannie
Posts: 33
Joined: Sat Jun 09, 2018 4:36 pm
Location: Netherlands
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Bottom height (sub)form

Unread post by Jannie »

This works, but I'll come back because during testing all my forms, I see there is also something wrong with height in grid subforms. Example is following within a few days
Jannie
Posts: 33
Joined: Sat Jun 09, 2018 4:36 pm
Location: Netherlands
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Bottom height (sub)form

Unread post by Jannie »

Height of subform in grid-layout is not as height as highest element.
Example with multiselectable:
GridBeforeUpgrade.jpg
GridAfterUpgrade.jpg
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Bottom height (sub)form

Unread post by kev1n »

Will the height be correct if you undo the change, add back the + 60 ?

Code: Select all

$edit      = ['height'=>$h + 60,  'width'=> $w];
Jannie
Posts: 33
Joined: Sat Jun 09, 2018 4:36 pm
Location: Netherlands
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Bottom height (sub)form

Unread post by Jannie »

Again thank you for reply. You are so helpful!

I tested with original version (add 60px), but problem still remains. Row-Heigth remains 25px
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Bottom height (sub)form

Unread post by kev1n »

Another thing you could try:

Replace the function nuFormDimensions() in nuform.php with this one (taken from an older nuBuilder version).

Code: Select all

function nuFormDimensions($f){

	$d			= array();
	$t			= nuRunQuery("SELECT * FROM zzzzsys_form WHERE zzzzsys_form_id = '$f'");
	$r			= db_fetch_object($t);
	
	$bt			= 57; 	//-- browse title
	$rh			= intval($r->sfo_browse_row_height)    == 0 ? 25 : $r->sfo_browse_row_height;
	$rs			= intval($r->sfo_browse_rows_per_page) == 0 ? 25 : $r->sfo_browse_rows_per_page;
	$bb			= 25;   //-- browse footer
	$t			= nuRunQuery("SELECT * FROM zzzzsys_object WHERE sob_all_zzzzsys_form_id = '$f'");
	$h			= 0;
	$w			= 0;
	$gh			= 0;
	$gw			= 0;
	
	while($r	= db_fetch_object($t)){
		
		if($r->sob_all_type == 'lookup'){
			
			$w 	= max($w, $r->sob_all_left + $r->sob_all_width + $r->sob_lookup_description_width + 40);
			$gw	= $gw + $r->sob_all_width + $r->sob_lookup_description_width + 40;
			
		}else{
			
			$w 	= max($w, $r->sob_all_left + $r->sob_all_width + 40);
			$gw = $gw + $r->sob_all_width + 4;
			
		}

		$h		= max($h, $r->sob_all_top + $r->sob_all_height);
		$gh 	= max($r->sob_all_height, 25, $gh);

	}

	$bh			= $bt + ($rs * $rh) + $bb;
	$bw			= nuGetBrowseWidth($f);	

	$grid		= ['height'=>$gh, 'width'=> $gw];
	$browse		= ['height'=>$bh, 'width'=> $bw];
	$edit		= ['height'=>$h,  'width'=> $w];


	
	$d[]		= $bt + ($rs * $rh) + $bb;    		//-- lookup browse height
	$d[]		= nuGetBrowseWidth($f);	
	$d[]		= $h  + 0;							//-- lookup form height
	$d[]		= $w  + 0;							//-- lookup form width
	$d[]		= $h  + 0;							//-- form height
	$d[]		= $w  + 50;							//-- form width
	$d[]		= $gh + 0;							//-- grid height
	$d[]		= $gw + 55;							//-- grid width
	
	$d[]		= ['browse'=>$browse, 'edit'=>$edit, 'grid'=>$grid];

	return ['browse'=>$browse, 'edit'=>$edit, 'grid'=>$grid];
	
}
Post Reply