Closed andre996 closed 1 week ago
Hi @andre996
Thanks for reporting. In the next release, you can use the pivotComparitor
in the columnDefs
like this:
columnDefs = [
{"field": "sport", "pivot": True, "pivotComparator": {"function": "sortColumns"}},
#...
]
Then define the function in dashAgGridFunctions.js
var dagfuncs = (window.dashAgGridFunctions = window.dashAgGridFunctions || {});
dagfuncs.sortColumns = (a, b) => b.localeCompare(a)
Description:
When attempting to implement the pivotComparator property on a pivoted table, using the function code from the Ag-Grid documentation for sorting, the pivot table fails to work as expected. The data is neither compared nor sorted correctly.
dash-ag-grid version:
Sample:
Note: Same behavior with the function on a JS file.