IDEMPIERE-1279 Grid column is often having default width that's too big. Workaround hflex not working correctly for first column.

This commit is contained in:
Heng Sin Low 2013-08-20 15:37:25 +08:00
parent ef3755aa2b
commit 16e7f5b1f7
1 changed files with 17 additions and 13 deletions

View File

@ -445,20 +445,24 @@ public class GridView extends Vbox implements EventListener<Event>, IdSpace, IFi
if (headerWidth > estimatedWidth)
estimatedWidth = headerWidth;
if (DisplayType.isLookup(gridField[i].getDisplayType()))
//hflex=min for first column not working well
if (i > 0)
{
if (headerWidth > MIN_COMBOBOX_WIDTH)
column.setHflex("min");
}
else if (DisplayType.isNumeric(gridField[i].getDisplayType()))
{
if (headerWidth > MIN_NUMERIC_COL_WIDTH)
column.setHflex("min");
}
else if (!DisplayType.isText(gridField[i].getDisplayType()))
{
if (headerWidth > MIN_COLUMN_WIDTH)
column.setHflex("min");
if (DisplayType.isLookup(gridField[i].getDisplayType()))
{
if (headerWidth > MIN_COMBOBOX_WIDTH)
column.setHflex("min");
}
else if (DisplayType.isNumeric(gridField[i].getDisplayType()))
{
if (headerWidth > MIN_NUMERIC_COL_WIDTH)
column.setHflex("min");
}
else if (!DisplayType.isText(gridField[i].getDisplayType()))
{
if (headerWidth > MIN_COLUMN_WIDTH)
column.setHflex("min");
}
}
//set estimated width if not using hflex=min