I should read more carefully before pasting lines from different places. Now I think it should not suppress the callback, because it sets currentSortKey and currentSortOrder, which are then used in sortFunction.
I'd place it right before RefreshData call, without SUPPRESS_CALLBACK:
Lua Code:
function UnitList:Initialize()
self.masterList = {}
ZO_ScrollList_AddDataType(self.list, 1, "UnitRow", 30, function(control, data) self:SetupUnitRow(control, data) end)
ZO_ScrollList_EnableHighlight(self.list, "ZO_ThinListHighlight")
self.sortFunction = function(listEntry1, listEntry2) return ZO_TableOrderingFunction(listEntry1.data, listEntry2.data, self.currentSortKey, UnitList.SORT_KEYS, self.currentSortOrder) end
self.sortHeaderGroup:SelectHeaderByKey("name")
self:RefreshData()
end
I'm still wondering how it could work without setting a sort key. I'd expect it to throw a "nil used as table key" error when there are 2 or more items in the list.