diff --git a/client/src/org/compiere/grid/VTable.java b/client/src/org/compiere/grid/VTable.java index 9a67879527..68ca4203d0 100644 --- a/client/src/org/compiere/grid/VTable.java +++ b/client/src/org/compiere/grid/VTable.java @@ -104,6 +104,7 @@ public final class VTable extends CTable return; } + sorting = true; // other sort column if (modelColumnIndex != p_lastSortIndex) p_asc = true; @@ -116,6 +117,8 @@ public final class VTable extends CTable + " - rows=" + rows + ", asc=" + p_asc); ((GridTable)model).sort(modelColumnIndex, p_asc); + + sorting = false; // table model fires "Sorted" DataStatus event which causes MTab to position to row 0 } // sort diff --git a/client/src/org/compiere/minigrid/MiniTable.java b/client/src/org/compiere/minigrid/MiniTable.java index c098972959..37706d0496 100644 --- a/client/src/org/compiere/minigrid/MiniTable.java +++ b/client/src/org/compiere/minigrid/MiniTable.java @@ -298,7 +298,9 @@ public class MiniTable extends CTable m_minWidth.add(new Integer(10)); tc.setMaxWidth(20); tc.setPreferredWidth(20); - tc.setResizable(false); + tc.setResizable(false); + + tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.Number)); } // Boolean else if (c == Boolean.class) @@ -314,6 +316,8 @@ public class MiniTable extends CTable tc.setCellEditor(new DefaultCellEditor(check)); } m_minWidth.add(new Integer(30)); + + tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.YesNo)); } // Date else if (c == Timestamp.class) @@ -323,7 +327,9 @@ public class MiniTable extends CTable tc.setCellEditor(new ROCellEditor()); else tc.setCellEditor(new MiniCellEditor(c)); - m_minWidth.add(new Integer(30)); + m_minWidth.add(new Integer(30)); + + tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.DateTime)); } // Amount else if (c == BigDecimal.class) @@ -338,7 +344,9 @@ public class MiniTable extends CTable { tc.setCellEditor(new MiniCellEditor(c)); m_minWidth.add(new Integer(80)); - } + } + + tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.Number)); } // Number else if (c == Double.class) @@ -353,7 +361,9 @@ public class MiniTable extends CTable { tc.setCellEditor(new MiniCellEditor(c)); m_minWidth.add(new Integer(80)); - } + } + + tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.Number)); } // Integer else if (c == Integer.class) @@ -363,7 +373,9 @@ public class MiniTable extends CTable tc.setCellEditor(new ROCellEditor()); else tc.setCellEditor(new MiniCellEditor(c)); - m_minWidth.add(new Integer(30)); + m_minWidth.add(new Integer(30)); + + tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.Number)); } // String else @@ -373,7 +385,9 @@ public class MiniTable extends CTable tc.setCellEditor(new ROCellEditor()); else tc.setCellEditor(new MiniCellEditor(String.class)); - m_minWidth.add(new Integer(30)); + m_minWidth.add(new Integer(30)); + + tc.setHeaderRenderer(new VHeaderRenderer(DisplayType.String)); } // log.fine( "Renderer=" + tc.getCellRenderer().toString() + ", Editor=" + tc.getCellEditor().toString()); } // setColumnClass