Hey Umbraco Friends 🙂
I'm currently working with a Custom Property Editor that involves Block Groups, each containing a title and a collection of value rows, essentially representing key-value pairs. This data is structured as an array of objects.
In my custom view, I'm using ng-repeat to display these Block Groups. Initially, I was tracking them by $index for CRUD operations. However, I've now switched to using orderBy: "title" to enable alphabetical sorting. Unfortunately, this adjustment has affected my existing logic. For instance, when deleting a Block Group by index, clicking "delete" on one Block Group results in the deletion of another. This becomes especially evident when attempting to delete the last Block Group (the one appearing last in alphabetical order), as it ends up deleting the most recently created Block Group (with the highest index).
Ideally, I would like to sort them alphabetically by their titles, at least from a visual standpoint, to facilitate easier navigation.
So here's my (perhaps not so straightforward) question: Is it feasible to simultaneously track by $index in ng-repeat while displaying Block Groups in alphabetical order? If this is possible, could you guide me on how to achieve it?
Any help is greatly appreciated!