Type script update - add sortDirection parameter to customSort function
Is your feature request related to a problem? Please describe.
No issue, only type update.
Describe the solution you'd like
Add optional parameter sortDirection to the customSort function here.
customSort?: (
data1: RowData,
data2: RowData,
- type: "row" | "group"
+ type: "row" | "group",
+ sortDirection?: "desc",
) => number;
Describe alternatives you've considered
The data manager is actually passing three parameters or passing the fourth parameter with "desc", see codes here, so the type is currently sortDirection?: "desc". But it may be more comprehensive if the sortDirection is "asc" | "desc".
Additional context
I want the sort direction because I want some records to always be on the top. https://codesandbox.io/s/material-table-starter-template-forked-vhgps?file=/src/index.js
It works even in typescript without the proposed change, but it's better if hints comes from typescript itself.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.
@tian-lan-landing Could you reopen this issue? I'm looking for this feature as well. Your solution really helps