From 83efe7a176c12971fba34c496b3d7790dfeba4a9 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 29 Jun 2009 08:16:27 +0000 Subject: [PATCH] https://sourceforge.net/tracker/?func=detail&aid=2813822&group_id=176962&atid=955896 - combobox button and numerbox button sometime not shown in grid view due to column width too small --- .../org/adempiere/webui/component/GridPanel.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java index 1bba5545ad..3eb4f27e03 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java @@ -60,6 +60,10 @@ public class GridPanel extends Borderlayout implements EventListener private static final int MAX_COLUMN_WIDTH = 300; + private static final int MIN_COMBOBOX_WIDTH = 160; + + private static final int MIN_NUMERIC_COL_WIDTH = 130; + private Grid listbox = null; private int pageSize = 100; @@ -270,6 +274,16 @@ public class GridPanel extends Borderlayout implements EventListener l = MAX_COLUMN_WIDTH; else if ( l < MIN_COLUMN_WIDTH) l = MIN_COLUMN_WIDTH; + if (gridField[i].getDisplayType() == DisplayType.Table || gridField[i].getDisplayType() == DisplayType.TableDir) + { + if (l < MIN_COMBOBOX_WIDTH) + l = MIN_COMBOBOX_WIDTH; + } + else if (DisplayType.isNumeric(gridField[i].getDisplayType())) + { + if (l < MIN_NUMERIC_COL_WIDTH) + l = MIN_NUMERIC_COL_WIDTH; + } column.setWidth(Integer.toString(l) + "px"); columns.appendChild(column); }