Grid column width (and height)

Hi guys,
please what’s the proper way of setting grid (no gridLayout) column width to auto? We tried setExpandRatio(0 or -1), clear expand ration, setWidth(“auto”), and god knows how many other things. Nothing works.

We need to set it so that the column width is only as wide as the cell in it.

And the same goes for the height of the grid. What’s the working way of setting the height of the grid please?:confused:

Thank you very much for any answer.

Hallowed are the Ori

I think the columns are always expanded if the combined width is less than the width of the whole grid. I don’t know if you can actually revert that behavior. I would’ve expected setExpandRatio(0) to work. A fixed columns size should at least work, but that’s probably not what you want, if you wish the width to come from the column content.

For the height, you can only either set it to an explicit height (e.g. 300px, 100%, etc.) or use setHeightByRows mode and define the amount of rows to show. Setting the height to undefined/auto/-1 probably goes back to the default 400px height.

Thank you very much Jouni :slight_smile: You’ve been very (much many most) helpful :slight_smile:

Oh one more question though.
You’ve said "you can only either set it to an explicit height (e.g. 300px, 100%, etc.) "
Well if I set it to 100%, it should spred to the height of it’s parent?
What if I set parent to auto so it’s as wide as it needs to be? Will there be the paradox?

I have a lot of problems with setting the height, I’m just the layout guy, I’m PROHIBITED (really:P) from writting the code. And I think that our programmers when expanding the layout are screwing with my css, right?

If they create verticla layout and put the layout which I created and styled into it and don’t set the proper height of that “wrapper” then my heights are go to hell, do I understand it correctly?

Uhm, one more:D
You’ve said (I’m not a generator, I’m a real human being!) " columns are always expanded if the combined width is less than the width of the whole grid." And if we have so many columns that you would need 3 screens to fit it in, then what happens? Something like “of screw this, if you have bazillion columns I won’t deal with it you, here is some random width”?:stuck_out_tongue:

Any relative width/height set in Java (i.e. setWidth/Height(“100%”)) require that the parent has a “defined width/height” also, so something else than -1 (which means auto/undefined). The Java code checks that and removes any invalid relative sizes, so if your parent layout height is auto, the contained layout height will also be auto even if you set it to 100% (in Java).

You can set the size in CSS as well, which is not removed, but layout expand ratio calculations expect the size to be defined in Java, so the expand calculations won’t kick in if the size is auto on the server side (Java code).

If the layout you built has height defined in Java code, then that can happen. But if you define the sizes in CSS, those should be intack, but as I pointed out earlier, the expand ratio calculations for your layout might not kick in.


If the combined column widths exceed the grid width, then a scrollbar will be provided, and the column widths should be as narrow as the content or what the column minWidth is.

The scrollbar is provided and then the screw you part comes into place:D We have a lot of columns, different shapes and sizes (pun intendet but don’t know if done right!) and they are not as narrow as the content. Is this some discrimination against Slovaks? I hope not, I thought Slovaks and Finns have a connection! We have a lot of Finns studying in a town named after me (ok it’s not named after me but it has the same name!) and when you are not playing against us in ice hockey I’m cheering for Finnish team! And often even if you are palying against us. What am I saying? What was I talking about? Sorry. Lalala

Thank you very much for the height/expand ration explanation, it helps a lot. You are great! Hallowed are the Oris and also the Finns!

One more:D question about the grid. My colleague is asking.
Is there some normal way for adding tooltips for grid cells? He sent me the css which he had to do to make it actually work and it’s pretty crazy. We need tooltips and also localization. So now we have for every cell three alternatives (three languages) and setting the content through css for it. Soooo kinda crazy.

And other part of that guestion:D We have problem with implementing font awesome into grid cell. It’s an known issue or are we doing something wrong please?

Pretty please