Thread: Order by name
View Single Post
09-13-14, 01:46 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,928
I haven't tested this but it is a variant of one that was listed at : http://forums.coronalabs.com/topic/4...e-on-2-values/


Lua Code:
  1. -- Sort Function
  2. local function SortTableByKey(a, b )
  3.   if (a.key < b.key) then
  4.     return true
  5.   elseif (a.key > b.key) then
  6.     return false
  7.   end
  8. end
  9.  
  10. -- Build table that can be sorted
  11. local accountant_sorted_data = {}
  12. for key,value in pairs(Accountant_Data) do
  13.   table.insert(accountant_sorted_data = { "Key" = key, "Value" = value })
  14. end
  15.  
  16. -- Sort Table
  17. table.sort( accountant_sorted_data, SortTableByKey)
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote