Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Listgrid column widths best practice/tricks

    Please consider the attached image from our web: Click image for larger version

Name:	Screen Shot 2020-03-05 at 10.53.17.png
Views:	309
Size:	13.6 KB
ID:	261296


    In our grids, we usually have some columns with short texts, some longer, some times, some icons.

    We prefer "clean" grids, i.e. not a lot of user interaction possible, the titles should display in its entirety, preferrably as little string partiality as possible etc.
    Also, we have quite a few columns, so horizontal widths are a scarce resource, as visible in the image.

    For these reasons, we ususally have fixed widths for the grids, as well as the columns themself. This leads to us having to have static int[] arrays everywhere with hard-coded widths for each listgrid, having to keep track of the order and contents of each column, so that the width is applied. Usually, one or more fields can be configured to take up "remaining space", so we set those to -1.

    My question is basically - in newer versions (we still use 6.0), is there some better way to accomplish this? Is there something you feel we have missed? The way we do things now do not work super-great when grids are resized.

    Our use cases:
    -Be able to specify varying min widths for certain columns, but have them take up remaining space, or expand horizontally depending on grid width. Would be great here with certain fields sharing the expanding equally if you see what i mean.
    -Be able to make a column autofit, for example around icons
    -Specify these parameters in XML, so that we don't have to hava java config-classes everywhere and use them when creating grids and fields.

    I hope i'm making sense, pointers and thoughts appreciated.


    #2
    We would strongly, strongly recommend making your grids variable width. Space is at a premium, and you aren't taking up the full browser width? Really bad idea. Imagine the user who has a screen-filling browser on a large screen and your application stubbornly refuses to use the space!

    After that, there's really not that much to do, because the default behavior is very good. If something has a known size, like an icon or date field, it receives that fixed size automatically and other fields flex.

    If there is a field where the framework has no idea it's always the same size, but you do, set a fixed width for that field.

    You could enable auto-fitting for titles, but it seems like you have pre-measured values for your titles in the font and density you use, so you could set those as minWidths instead and avoid the cost of auto-fitting.

    For other fields for which you have widths, you could convert those to percents so that, after fixed-size fields get their space, the remaining space is divided up proportionally.

    Comment

    Working...
    X