[question] Am I able to provide multiple rules to the initialState sortModel for DataGridPro #10716
Labels
component: data grid
This is the name of the generic UI component, not the React module!
feature: Sorting
Related to the data grid Sorting feature
support: commercial
Support request from paid users
support: question
Community support but can be turned into an improvement
The problem in depth 🔍
I am using DataGridPro with many columns. I want to provide multiple columns in the
initialState
sortModel
.In the documentation, I see only one sorting rule provided:
sortModel: [{ field: 'rating', sort: 'desc' }]
However, I want to know if it's possible to pass multiple rules to
sortModel
. For instance,In this scenario, I would expect, all rows with 5 stars be sorted to the top. And within the 5 star rows, a secondary sorting is applied that sorts names in ascending order.
Thanks!
Your environment 🌎
`npx @mui/envinfo`
Search keywords: datagrid default column sorting sortModel
Order ID: 67129
The text was updated successfully, but these errors were encountered: