------=_Part_4640012_120094896.1399991871152
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Hey guys,
oVirt UI has been missing column sort functionality for quite a while
now, but here's some good news.
I've just merged patch [1] that adds support for both server-side and
client-side sorting of table columns. This patch adds the necessary
infra/API; column sorting must be enabled per-column for given table,
just like with column resizing.
[1]
http://gerrit.ovirt.org/#/c/25910/
Currently, only TextColumnWithTooltip (and its subclasses) support
sorting, however this can easily be changed in future by having the
column class extend SortableColumn.
To enable sorting:
// Enables server-side sorting via search query
// ... SORTBY name ASC|DESC
column.makeSortable("name"); // consider using shared constant
-or-
// Enables client-side sorting using comparator
column.makeSortable(comparator);
In order for server-side sorting to work properly, corresponding
SearchableListModel must apply the search options while executing
"Search" query.
For example, in DataCenterListModel:
@Override
public boolean supportsServerSideSorting() {
// Default is false
return true;
}
@Override
protected void syncSearch() {
// Append "SORTBY" clause to search query
String search = applySortOptions(getSearchString());
...
}
If a model doesn't support server-side sorting, client-side sorting
will be used as fall back (assuming a comparator was provided).
In general, all main tab list models in WebAdmin utilize "Search"
query, so we can enable server-side sorting for columns that exist
within main tab tables.
As for sub tabs (whose list models generally don't use "Search"
query, but also don't support paging at the moment), these can
simply use client-side sorting, i.e. reuse existing comparators
defined in Linq class.
PS: I've attached a screenshot depicting sorted column in action.
Regards,
Vojtech
------=_Part_4640012_120094896.1399991871152
Content-Type: image/png; name=sorted-column.png
Content-Disposition: attachment; filename=sorted-column.png
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAALQAAACnCAYAAAC4j3YHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
B3RJTUUH3gUNDiIpMfRzFAAAGZdJREFUeJzt3XlcVdXC//HPOYBwFBQUUFIQTEUfkHKg6xPOYw5J
kXWdbnYbsG6P1XPN1DQ1eyrU7OnavaXcX5mg3kckvQpqOOKAI45kmgoOCAKCosh44KzfH8iWg4Cc
AaHder9eR8+e1lp7nS+bfTb7rKOZOHGiEEIghEB6tDQaD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