General Category > Bug Report

Autofit after refresh data and view

(1/2) > >>

motoguru:
Next problem :)

I'm using simple script which is hidding columns "live" and then fires "refreshDataAndView" on grid. Ocassionally, when all columns are hidden and then I'm bringing them back (by using colModel[column].hidden = false;  or true) autoFit on column widths couting width wrong. Screen attached - upper grid is before show and hide actions, lower one is after few hide/show column operations. Widths are different, no other colModel settings are modified. In scrollModel autoFit is enabled. My colModel is the one from another thread (this one about filtering and searching).

Sorry for the grid visibility - graphic designer is about to start restyling it. You can see horizontal black lines slightly different than dark gray cell background and they are column separators (cell borders).

Upd: there is a letter mistake on the screenshot, should be: refreshDataAndView instead refreshDateAndView.

paramvir:
With autoFit : true the column widths won't remain the same after you hide all columns and show them again as widths are re-computed according to the available width in the viewport everytime columns are hidden/shown.

motoguru:
Why widths are not computed to proportionally (each equal) fit all the grid width all the time..? I mean why they start proportionally and then, when hidden/shown again they're not proportionally equal, then refresh (f5) and they are equal again? It's a bit strange behaviour. Nothing changed in 2.0.4.

paramvir:
The purpose of autoFit is to prevent scrolling and fill up the entire width of the viewport by distributing extra / deficient width space equally among columns.

Its purpose is not to maintain equal widths.

motoguru:
So how to get result I want? For example:

I got 8 columns at start. My grid is 800px width, so I want them to be 100px each (and its done by autofit initially). Then, I want to hide 4 of them, so now I have 4 columns. Obviously, when I would start with 4, autofit would make them 200px each. It does "live", but when I bring 4 columns back (to get 8 like before) and do it "live", widths are computed according to screen attached (like randomly?, for example col1: 120px, col2: 200px, col3:200px and so on to fill 800px...). How to bring them back and split 800px ALWAYS equally between columns after show/hide operations (like an old html table width="*" behaviour). Don't know how to explain it in more detailed way to be honest...

Navigation

[0] Message Index

[#] Next page

Go to full version