Originally Posted by merlight
You don't need to sort anything in BuildMasterList. There's SortScrollList for that, it's called after the list is filtered to sort only items that pass the filter; and also when sort order changes, the list is not rebuilt, just sorted again. I'm looking into SLE and it looks like everything's in place.
Try this in UnitList:Initialize():
Lua Code:
units.sortHeaderGroup:SelectHeaderByKey("name", ZO_SortHeaderGroup.SUPPRESS_CALLBACKS)
edited: wrong member name
|
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:RefreshData()
end
My Current code looks like the attached image, should I put this at the end of the method or where?