Closed rivella50 closed 2 years ago
You can actually use use the groupComperator for this. Inside you can compare the static state values and hard code the order of the states. I think this is the solution you are thinking of.
A more flexible solution would be to have a order mapped to each state so that the ordering itself does not have to be hard coded in the groupComparator.
Works fine, thanks a lot.
Hi there, let's say i have list items and know that they can only have a discrete number of possible state values (e.g. 'new', 'inbox', 'planned') which should serve as our groups. Now i have to render groups in a specific order which cannot be established by comparing the group names, i.e. the option using groupComparator falls away. Is there a way that this can be achieved currently with grouped_list, where neither a comparator nor natural sort order would be correct? If not how about a new option (e.g. 'specificGroupOrder'), where the user can overrule all sorting algorithms and provide the group names in the order he actually needs in the rendered view?
Thanks for considering my request.