Thread: ZO_Helpers
View Single Post
10/11/14, 05:07 PM   #5
Argusus
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 120
Originally Posted by merlight View Post
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:
  1. 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?
Attached Thumbnails
Click image for larger version

Name:	example.png
Views:	591
Size:	11.7 KB
ID:	488  
  Reply With Quote