Force a fixed column width in AppGini 5.20

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
User avatar
a.gneady
Site Admin
Posts: 748
Joined: 2012-09-27 14:46
Contact:

Force a fixed column width in AppGini 5.20

Post by a.gneady » 2013-10-30 04:39

You might have noticed when using AppGini 5.20 that in the table view, column widths are dynamic ... they get wider on large screens and narrower on small/mobile screens .. this is due to the responsive nature of Bootstrap themes ... but what if you want to force a specific column to retain a fixed width regardless of screen size?

In the generated "dynamic.css.php" file, add a CSS rule similar to this:

Code: Select all

.tablename-fieldname{ max-width: 300px; min-width: 300px; }
For example, if your table is named "orders", and field is "order_date", you can fix the width to 250px like this:

Code: Select all

.orders-order_date{ max-width: 250px; min-width: 250px; }
:idea: Learn all the tips and tricks of customizing AppGini applications through our new online course.

AppGini: Responsive, collaborative web database applications in minutes.

pgkounelas
Posts: 10
Joined: 2013-01-30 14:55
Location: Larissa, Hellas

Re: Force a fixed column width in AppGini 5.20

Post by pgkounelas » 2013-10-30 10:16

How to wrap the text in this case.

User avatar
a.gneady
Site Admin
Posts: 748
Joined: 2012-09-27 14:46
Contact:

Re: Force a fixed column width in AppGini 5.20

Post by a.gneady » 2013-11-11 02:43

pgkounelas wrote:How to wrap the text in this case.
Try this:

Code: Select all

.orders-order_date{ max-width: 250px; min-width: 250px; white-space: normal !important; }
:idea: Learn all the tips and tricks of customizing AppGini applications through our new online course.

AppGini: Responsive, collaborative web database applications in minutes.

dragon
Veteran Member
Posts: 44
Joined: 2015-09-29 00:06

Re: Force a fixed column width in AppGini 5.20

Post by dragon » 2015-10-01 00:33

In addition to what was said above you can also truncate the text in the cell by using this:

Code: Select all

white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
Appgini 5.50, Revision 835. Mac OSX 10.11 running Windows 10 on VMWare.

thetoolwiz
Posts: 7
Joined: 2016-04-04 19:59

Re: Force a fixed column width in AppGini 5.20

Post by thetoolwiz » 2017-03-18 06:42

In AppGini 5.60, my dynamic.css.php file contains a bunch of lines that look like this:

.Passengers-Name{ white-space: normal !important; max-width: 150px !important; min-width: 150px !important; overflow: hidden; }

The actual widths vary, because I set these up in the column-width spec, which seems to only apply to table view, not detail view.

Why don't these also apply to detail view fields as well? If you can specify for one, why not both?

Besides, the table view will typically be viewed in landscape mode, while the detail view will be viewed in portrait mode. At least, this is how I do things. So I'd set the widths differently for table and detail views anyway.

Post Reply