PDA

View Full Version : Grid width



jaguar82
4 Oct 2010, 4:10 AM
Hello all

I think that I am missing something with the grid width.

I have a web page with 2 sides.
On the right side I have Ext.grid.GridPanel element with 3 columns.
I like that the grid will be 100% of the right side width.
In addition I like that the first column in the grid will be 50% of the grid, and the 2 other columns will be 25% each (of the grid width).

But the problem is that clumns width must be in pixels and not percenteges.
But if I set the width in pixels, the grid isn't 100% of the screen for other screen sizes.

Note: The grid width set automaticlly acording to the columns size. I don't set it by myself.



For example:
My screen width is 1600px.
The right side is 800px. This is the grid size (on my computer).
So the first column should be 400px, and the other columns should be 200px each.

The only problem with that is that other screens could be 1200px (and then the grid is out of the screen)
or 1800px and then grid is not 100% of the right side.

Why can't I set the column size in percentages?
Is there any known solution for this?:-?
The exact percentage aren't metter, are only want that the first column will be much bigger the others.

Thanks in advance

sven
4 Oct 2010, 4:16 AM
You should use the layoutsystem to size your grid to be 100%.

Than you can use forceFit on the gridview and give the first column a width of 100px and the second and third a width of 50px. forcefit should than resize it.


The exact percentage aren't metter, are only want that the first column will be much bigger the others.
Than you could even use autoExpandColumn on your first column.

jaguar82
4 Oct 2010, 5:46 AM
That the issue.
I do use viewConfig:{forceFit: true} (in the grid).
It seens to have no effect on it.

I will try to use autoExpandColumn.
Thanks.

sven
4 Oct 2010, 5:48 AM
Is it possible that you use ExtJS? This is the GXT forum.

I do use viewConfig:{forceFit: true} (in the grid).
It seens to have no effect on it.

Probably you are not sizing your grid.

oneTETSUO
7 Oct 2010, 6:16 AM
grid.setSize( 1920, 1080);

similar in extjs (in this rare case), otherwise its a completely different engine