Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Bottom height (sub)form
-
- 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
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?
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?
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
-
- 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
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
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.
-
- 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
Let me check if the same behavior occurs on my end. I'll get back to you.
-
- 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
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.
https://github.com/steven-copley/nubuil ... .php#L1352
If this + 60 is removed, the gap will be gone.
Code: Select all
$edit = ['height'=>$h + 60, 'width'=> $w];
Code: Select all
$edit = ['height'=>$h, 'width'=> $w];
If this + 60 is removed, the gap will be gone.
-
- 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
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
-
- 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
Height of subform in grid-layout is not as height as highest element.
Example with multiselectable:
Example with multiselectable:
You do not have the required permissions to view the files attached to this post.
-
- 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
Will the height be correct if you undo the change, add back the + 60 ?
Code: Select all
$edit = ['height'=>$h + 60, 'width'=> $w];
-
- 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
Again thank you for reply. You are so helpful!
I tested with original version (add 60px), but problem still remains. Row-Heigth remains 25px
I tested with original version (add 60px), but problem still remains. Row-Heigth remains 25px
-
- 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
Another thing you could try:
Replace the function nuFormDimensions() in nuform.php with this one (taken from an older nuBuilder version).
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];
}