diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2007-06-29 10:27:59 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2007-06-29 10:27:59 +0000 |
commit | e11295e392f96ee6788e1a7eab1e65e061a6ba29 (patch) | |
tree | 92b35e3cc82dbfd37eef885296536a96e4479183 /src | |
parent | 06f57f4c8227b32c119f5933373b6dc8f8b2f98a (diff) | |
download | vaadin-framework-e11295e392f96ee6788e1a7eab1e65e061a6ba29.tar.gz vaadin-framework-e11295e392f96ee6788e1a7eab1e65e061a6ba29.zip |
re-enabled sorting
svn changeset:1803/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/scrolltable/IScrollTable.java | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/scrolltable/IScrollTable.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/scrolltable/IScrollTable.java index 98225395e2..b8123294e7 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/scrolltable/IScrollTable.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/scrolltable/IScrollTable.java @@ -439,7 +439,7 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll } - public class HeaderCell extends Widget implements ClickListener { + public class HeaderCell extends Widget { private static final int DRAG_WIDGET_WIDTH = 2; @@ -517,25 +517,6 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll return cid; } - /** - * Listens clicks to headers text. This changes sorting. - */ - public void onClick(Widget sender) { - if(sortColumn.equals(cid)) { - // just toggle order - client.updateVariable(id, "sortascending", !sortAscending, false); - } else { - // set table scrolled by this column - client.updateVariable(id, "sortcolumn", cid, false); - } - // get also cache columns at the same request - bodyContainer.setScrollPosition(0); - firstvisible = 0; - rowRequestHandler.setReqFirstRow(0); - rowRequestHandler.setReqRows((int) (2*pageLength*CACHE_RATE + pageLength)); - rowRequestHandler.deferRowFetch(); - } - private void setSorted(boolean sorted) { if(sorted) { if(sortAscending) @@ -578,8 +559,24 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll break; case Event.ONMOUSEUP: dragging = false; + DOM.releaseCapture(getElement()); + if(!moved) { - // sort + if(sortable) { + if(sortColumn.equals(cid)) { + // just toggle order + client.updateVariable(id, "sortascending", !sortAscending, false); + } else { + // set table scrolled by this column + client.updateVariable(id, "sortcolumn", cid, false); + } + // get also cache columns at the same request + bodyContainer.setScrollPosition(0); + firstvisible = 0; + rowRequestHandler.setReqFirstRow(0); + rowRequestHandler.setReqRows((int) (2*pageLength*CACHE_RATE + pageLength)); + rowRequestHandler.deferRowFetch(); + } break; } System.out.println("Stopped column reordering"); @@ -590,7 +587,6 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll else reOrderColumn(cid, closestSlot); } - DOM.releaseCapture(getElement()); break; case Event.ONMOUSEMOVE: if (dragging) { |