Closed n3n closed 1 year ago
I use @ as a operation separator from field name (the same as filter but for sort)
@
const TodoList = (props) => ( <List sort={{ field: 'title@nulls_last,is_completed', order: 'asc,desc' }} {...props}> <Datagrid rowClick="edit">...</Datagrid> </List> );
will generate a query with an order_by:
order_by
order_by: [{ title: "asc_nulls_last" }, { is_completed: "desc" }]
const TodoList = (props) => ( <List {...props}> <Datagrid> <TextField source="title" sortBy="title@nulls_last" /> </Datagrid> </List> );
order_by: [{ title: "asc_nulls_last" }]
@n3n thank you for both of your PRs friend!
I use
@
as a operation separator from field name (the same as filter but for sort)Example
List default sort field
will generate a query with an
order_by
:Field sortBy
will generate a query with an
order_by
: