简体   繁体   English

在 Fluent UI 的详细信息列表中的 header 列中添加排序图标

[英]Adding sorting icon in column header in Details List in Fluent UI

For a DetailsList or ShimmeredDetailsList, I need to add two arrows (one up, one down) besides the column name in the column header so that the user can look at the grid and tell which column is sortable and which is not.对于 DetailsList 或 ShimmeredDetailsList,我需要在 header 列中的列名之外添加两个箭头(一个向上,一个向下),以便用户可以查看网格并判断哪一列可排序,哪一列不可排序。 Currently I am using isSorted and isSortedDescending in IColumn, but that only brings an up or down arrow once the user clicks on that column.目前我在 IColumn 中使用isSortedisSortedDescending ,但是一旦用户单击该列,它只会带来一个向上或向下箭头。 It doesn't produce any icon that tells the user by just seeing the grid which column is sortable.它不会产生任何图标来告诉用户仅通过查看网格哪一列是可排序的。 How can that be done?怎么可能呢?

You need to register the sort icon.您需要注册sort图标。

registerIcons({
    icons: {
    sort: <Sort />,
    sortdown: <ChevronUp />,
    sortup: <ChevronDown />,
  },
});

https://github.com/microsoft/fluentui/wiki/Using-icons#custom-svg-icons https://github.com/microsoft/fluentui/wiki/Using-icons#custom-svg-icons

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

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