当你调用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);
}
感谢您的答复。以上代码jonic用于翻转订单。我的问题是,我想在celltable加载后显示列的排序顺序。例如。我有xml。根据列信息,我只能获取一列信息,即列(columnname,sortedOrder [false/true],dataTypeOf),我希望按值设置ASC/DESC图标靠近列。 – StackOverFlow
我编辑了我的答案以包含您的用例。 –