summaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/com/vaadin/client/widgets/Grid.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java
index 3033d74867..7086ff86d2 100644
--- a/client/src/com/vaadin/client/widgets/Grid.java
+++ b/client/src/com/vaadin/client/widgets/Grid.java
@@ -5612,18 +5612,26 @@ public class Grid<T> extends ResizeComposite implements
FlyweightCell cell) {
cleanup(cell);
+ if (!headerRow.isDefault()) {
+ // Nothing more to do if not in the default row
+ return;
+ }
Column<?, ?> column = getVisibleColumn(cell.getColumn());
SortOrder sortingOrder = getSortOrder(column);
- if (!headerRow.isDefault() || !column.isSortable()
- || sortingOrder == null) {
- // Only apply sorting indicators to sortable header columns in
- // the default header row
- return;
- }
+ boolean sortable = column.isSortable();
Element cellElement = cell.getElement();
+ if (sortable) {
+ cellElement.addClassName("sortable");
+ }
+
+ if (!sortable || sortingOrder == null) {
+ // Only apply sorting indicators to sortable header columns
+ return;
+ }
+
if (SortDirection.ASCENDING == sortingOrder.getDirection()) {
cellElement.addClassName("sort-asc");
} else {
@@ -5656,6 +5664,7 @@ public class Grid<T> extends ResizeComposite implements
cellElement.removeAttribute("sort-order");
cellElement.removeClassName("sort-desc");
cellElement.removeClassName("sort-asc");
+ cellElement.removeClassName("sortable");
}
@Override