View Single Post
12-23-06, 01:09 PM   #1
Zeksie
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 24
Custom sort func for SecureHeaders

Would be useful to have ability to set a custom sorting function for the party and raid headers. Useful for named lists, or abitrary class selections that would benefit from class order for example.

So, in the configureChildren function in SecureTemplates.lua, something like this:

Code:
	local sortMethod = self:GetAttribute("sortMethod") or "INDEX"; --sort by ID by default
	local sortDir = self:GetAttribute("sortDir") or "ASC"; --sort ascending by default
        local customSort = self:GetAttribute("sortFunc")

        if (type(customSort) == "function") then
                table.sort(sortingTable, customSort)
        elseif ( sortMethod == "NAME" ) then
		table.sort(sortingTable);
	end
  Reply With Quote