Possible to change JS form height on the fly?
Hi reg,
You can change the form height (and width) at runtime, in the $init
method of the form, but there are several caveats. Here is a a real
life example :
$init
——
;; Datas is an Omnis list displayed as a html table by the form which
is “hand coded” in a form’s html control
;; the list might contain from 0 to several hundreths of lines, so he
height of the table is unknown before runtime
If $cinst.$objs.$findname(‘Datas’)
JavaScript: var h = $(“#Datas”).height();
Calculate h as max(h*1,ClassHeight*1) ;; classheight is an
instance var that holds the height of the class
If not(isclear(h))
;; there is an Omnis limit for height around 20000, so lets
make sure to stay way below at 16 000 pixels
Calculate h as min(16000,h*1)
Do $cinst.$height.$assign(h) ;; resize the form
End If
End If
Depending of the browser or device used, when you enlarge your form
this way, you must also force the browser to draw a scroll, because
Omnis won’t do it automatically. If you don’t do it yourself, your
users might end up with a non scrollable form pretty much frozen, that
might look exactly like it has crashed 🙁
So to avoid this scary scenario, add this script to your html page :
Regards
Bruno
By Design
[1]http://www.bydesign.fr
Bruno Del Sol
[2]bruno.delsol@bydesign.fr
tel (33) 01 48 78 47 37
46, rue de La Tour d’Auvergne
75009 Paris (France)
Le 21/11/2017 à 10:08, Reg Paling a écrit :
Hi all,
My paged pane JS form is looking good, but some panes have more
content (vertically) and other have less. I would like to get rid
of the white space at the bottom of those pages which have less
content on them. Otherwise on both phones and desktop browsers the
user could never be sure there was “nothing to see there” without
scrolling down to the bottom of the extra white space. As the user
works through the pages of the paged pane, I can adjust the $height
of the paged pane – if I give the paged pane a coloured background I
can see that happening, but to get rid of the empty space below it I
would like to adjust the overall height of the form on the fly.
(There is a somewhat related property called $layoutminheight, but
that manages a different issue.)
Is it possible?
Thanks,
Reg
_____________________________________________________________
Manage your list subscriptions at [3]http://lists.omnis-dev.com
References
1. www.bydesign.fr/
2. mailto:bruno.delsol@bydesign.fr
3. lists.omnis-dev.com/
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com