[英]GWT CELLTABLE : How to set columns descending icon on celltable header?
如何设置单元格表头上的列降序图标,即DESC图标?
关于单元格加载..我想设置列的排序顺序,即用户先前排序的列/排序顺序(在上次登录时,在注销之前)
我尝试按照以下方式table.getColumnSortList()。push(testColumn); 例如,在标题顶部使用ASC Icon将列升序设置为true。
现在我想将列设置为降序,即顶部标题上的DESC图标? 怎么做 ?
在这方面的任何帮助或指导将不胜感激
如果没有在列上设置排序信息,则在调用table.getColumnSortList().push(testColumn)
时, table.getColumnSortList().push(testColumn)
排序设置为升序。 如果您再次调用它,则会颠倒排序顺序。
// Show the descending sort icon on a column.
ColumnSortInfo sortInfo = table.getColumnSortList().push(testColumn);
if (sortInfo.isAscending()) {
table.getColumnSortList().push(testColumn);
}
要根据保存在变量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.