Core Loot Manager DKP & EPGP & SK

Core Loot Manager DKP & EPGP & SK

1M Downloads

UI Name/Class Sorting

mythrasus opened this issue ยท 5 comments

commented

A suggestion, that within the standings view - whilst when you select Name will sort automatically by alphabetical position. This is not the case elsewhere, clicking on Class whilst grouping by class it neither lists them automatically, nor the names of the players are listed automatically.

Could we have it that the sort is set to alphabetical no matter which sort view you select for ease of use.

Thanks

commented

All tables are sortable, but the sort is often not so obvious as it is being sorted by text. And text for e.g. Warlock named Mythrasus is actually |cff8787EDMythrasus|r thus the sorting first happens based on color... We would need to create special sorting functions for columns using colors

commented

This seems like low-hanging fruit, and Idk if you have addressed this already or not, but here are some of my thoughts:

If you have sorting/comparative functions already. All it would take would be to check if the string contains a color string.char(1, 1+1) or by using gsub to see if the string's first two characters are |c and if the last two characters are |r, you can then just simply gsub the two texts to get their base text via: string.sub(s, 10, -2) and voila, you have the custom sort function. If you wanted you could also add in a length checker to ensure that the string is actually greater than 12 characters long before you actually strip it down to have some additional guards in place.

|cff8787ED - 10 Characters
|r - 2 Characters

Alternatively, I solved this previously by passing the dataObject to the row in question, as I needed it for some other functions, and just sorted on the un-colored text in the dataObj & rendering the colored text visually.

commented

Yeah i did somewhat put this in an oblivion but might fix it quickly in next release.
Also FYI lua substring is inclusive so it is actually string.sub(<string>, 11, -3)

commented

Fair enough, been language hopping too much lately!

commented

Shouldn't we generalize this to: Tables should be sortable by clicking on column headers ?