From 16e7f5b1f7c819f58e588a79350db159d5062ef8 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 20 Aug 2013 15:37:25 +0800 Subject: [PATCH] IDEMPIERE-1279 Grid column is often having default width that's too big. Workaround hflex not working correctly for first column. --- .../adempiere/webui/adwindow/GridView.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java index 0976282138..8a374dd7e9 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java @@ -445,20 +445,24 @@ public class GridView extends Vbox implements EventListener, 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