简体   繁体   English

GWT CELLTABLE:如何在celltable标头上设置列降序图标?

[英]GWT CELLTABLE : How to set columns descending icon on celltable header?

How to set columns descending icon ie DESC icon on celltable header ? 如何设置单元格表头上的列降序图标,即DESC图标?

On celltable loading.. I want to set sorting order to column ie previously sorted column/sorting order by user (In last login , before logout) 关于单元格加载..我想设置列的排序顺序,即用户先前排序的列/排序顺序(在上次登录时,在注销之前)

I tried following way table.getColumnSortList().push(testColumn); 我尝试按照以下方式table.getColumnSortList()。push(testColumn); ie setting column ascending to true with ASC Icon on top of header.It works fine 例如,在标题顶部使用ASC Icon将列升序设置为true。

Now I want to set column in descending ie DESC icon on top header ? 现在我想将列设置为降序,即顶部标题上的DESC图标? How to do it ? 怎么做 ?

Any help or guidance in this matter would be appreciated 在这方面的任何帮助或指导将不胜感激

When you call table.getColumnSortList().push(testColumn) if no sort info is set on the column it sets the sort to ascending. 如果没有在列上设置排序信息,则在调用table.getColumnSortList().push(testColumn)时, table.getColumnSortList().push(testColumn)排序设置为升序。 If you call it another time it reverses the sort order. 如果您再次调用它,则会颠倒排序顺序。

// Show the descending sort icon on a column.
ColumnSortInfo sortInfo = table.getColumnSortList().push(testColumn);
if (sortInfo.isAscending()) {
    table.getColumnSortList().push(testColumn);
}

To set the sort icon according to state saved in variable sortOrder: 要根据保存在变量sortOrder中的状态设置排序图标:

// Assuming sortedOrder = true means ascending
// and sortedOrder = false means descending
ColumnSortInfo sortInfo = table.getColumnSortList().push(testColumn);
if (sortedOrder && !sortInfo.isAscending()) {
    table.getColumnSortList().push(testColumn);
}
else if (!sortedOrder && sortInfo.isAscending()) {
    table.getColumnSortList().push(testColumn);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM