为gwt单元格表格上的初始标题单击设置默认排序顺序 [英] Set default sort order for initial header click on gwt cell table
问题描述
我有一个可排序列的GWT CellTable,与开发人员指南示例非常相似( http://code.google.com/webtoolkit/doc/latest/DevGuideUiCellTable.html#columnSorting )。
然而,我想有某些列按降序排序而不是默认升序。也就是说,如果列A当前没有排序,并且点击它的标题,我希望列A在第一次点击时降序排序,在第二次点击时升序排序。但我仍然希望其他列按照他们目前的排序进行排序 - 在第一次点击时使用升序排序。
除了用于设置排序功能的Column.setSortable(boolean)方法之外和ColumnSortList.push(ColumnSortInfo)方法手动触发排序,似乎没有太多的控制过程。有没有办法做到这一点目标是什么?
Column.setDefaultSortAscending(false)
去做这个;没有自定义 CellTable
需要。
I have a GWT CellTable with sortable columns very similar to the developer's guide example (http://code.google.com/webtoolkit/doc/latest/DevGuideUiCellTable.html#columnSorting).
However, I would like to have certain columns sort descending instead of ascending by default. That is, if column A is not currently sorted and I click on it's header, I want column A to be sorted descending on that first click and ascending on the second click. But I do still want other columns to sort as they currently do - using ascending order on the first click.
Aside from the Column.setSortable(boolean) method to set sortability and the ColumnSortList.push(ColumnSortInfo) method to manually trigger a sort, there doesn't seem to be much control over the process.
Is there a way to accomplish this goal?
Column.setDefaultSortAscending(false)
is the easy way to do this; no custom CellTable
required.
这篇关于为gwt单元格表格上的初始标题单击设置默认排序顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!