Replies: 1 comment 2 replies
-
Hey @ammma, Not sure about the most elegant way to tackle this but I believe this could be a quickfix for your use case. In your module repository :
This will ensure that your new items are added to the top of the list, at the cost of a few extra queries. Hope this can help! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Presently if you enable
reorder
option in controller then any values put in$defaultOrders
will be ignored and list will be sorted by position ascending. This cuts use cases this feature can handle by half.For example: i need to build an admin page which reflects front-end and to do so i need an ability to reorder items AND to have newly created items to go to the top of the list, not to the bottom.
And most elegant way to do this i think it to make
ModuleController
to work with$defaultOrders = ['position'=>'desc']
Beta Was this translation helpful? Give feedback.
All reactions