Thread Tools Display Modes
Prev Previous Post   Next Post Next
11/12/14, 01:03 PM   #1
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
[outdated] ZO_ComboBox sort order

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:
  1. combo:SetSortOrder(ZO_SORT_ORDER_UP, {priority={tiebreaker="name"}, name={}})
  2. combo:SetPrimarySortKey("priority") -- or a third parameter to the previous function, doesn't matter much
 
 

ESOUI » Developer Discussions » Wish List » [outdated] ZO_ComboBox sort order


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off