[英]How to sort by the row group count in ag grid?
您需要定義自定義排序:
const gridOptions = {
columnDefs: [
{
field: 'age',
// simple number comparator
comparator: (valueA, valueB, nodeA, nodeB, isInverted) => valueA - valueB
},
{
field: 'name',
// simple string comparator
comparator: (valueA, valueB, nodeA, nodeB, isInverted) => {
if (valueA == valueB) return 0;
return (valueA > valueB) ? 1 : -1;
}
}
],
// other grid options ...
}
https://www.ag-grid.com/javascript-data-grid/row-sorting/#custom-sorting
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.