我可以看到您的帖子中有很多问题(以及您遇到的困惑:))。
1. “如果只有 1 列可排序,则不会打印数字。但如果可以排序多于 1 列,agGrid 会在标题中显示这些数字。”
如果您想启用多重排序并且不想看到指示排序顺序的数字,那么您可以使用 CSS 来实现。
检查这个笨蛋:ag-grid 多列排序 - 隐藏排序顺序编号
.ag-header-cell-label .ag-header-icon.ag-sort-order {
display: none
}
2. “此外,一旦我单击任何标题来触发排序,数字就会消失......”
ag-grid sorting on multiple columns works when you click on column with Ctrl pressed.
If multi-column sort is already there, and if you click on any other column without Ctrl, then the older column sorting vanished, and it is replaced with the last column you have clicked.
3. 如果要禁用多重排序,则需要设置以下属性ag-grid
element
[suppressMultiSort]="true"
4. multiSortKey 可以更改 - 您需要将其作为以下属性提及
multiSortKey = "ctrl";
你可以在我提供的Plunk中看到。
希望这可以帮助。