ZO_ComboBox allows custom ordering of items via ZO_ComboBox:SetSortOrder(sortOrder, sortType)
I can attach custom data to entries, and use them for sorting, but currently only as tiebreakers. The limitation lies in function ComboBoxSortHelper, where "name" is hardcoded as the primary sort key.
I have a combo box with 1 "default" item and a variable number of user-created items. The "default" item shall always be on top of the drop-down list, while the rest should be properly sorted (they can be added/removed at run-time). So I added "priority" key to each entry, the "default" entry has priority=1, user entries have priority=2. Now I want to set "priority" as the primary sort key, and "name" as the tiebreaker, like this:
Lua Code:
combo:SetSortOrder(ZO_SORT_ORDER_UP, {priority={tiebreaker="name"}, name={}})
combo:SetPrimarySortKey("priority") -- or a third parameter to the previous function, doesn't matter much