AmadanNaBriona
May 12th, 2020, 15:31
I have a Talents group in my data library that I want to sort either by Letter (alphabetically) or IQ.
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=35241&d=1589293520
It works, except I get this:
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=35242&d=1589293705
You can see that the talents listed by IQ are sorted alphabetically.
I can make it work by setting the aGroupValueOrder for the "byiq" aListViews in my data_library.lua script to be a literal array of numbers, e.g.: {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"}. But it seems like there should be a way to just make it sort numerically?
Relevant code:
["talent"] = {
["byletter"] = {
sTitleRes = "talent_grouped_title_byletter",
aColumns = {
{ sName = "name", sType = "string", sHeadingRes = "talent_grouped_label_name", nWidth=250 },
{ sName = "iq", sType = "number", sHeadingRes = "talent_grouped_label_iq", nWidth=25 },
},
aFilters = {},
aGroups = { { sDBField = "name", nLength = 1 } },
aGroupValueOrder = { },
},
["byiq"] = {
sTitleRes = "talent_grouped_title_byiq",
aColumns = {
{ sName = "name", sType = "string", sHeadingRes = "talent_grouped_label_name", nWidth=250 },
{ sName = "iq", sType = "number", sHeadingRes = "talent_grouped_label_iq", nWidth=25 },
},
aFilters = {},
aGroups = { { sDBField = "iq" } },
aGroupValueOrder = {},
},
},
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=35241&d=1589293520
It works, except I get this:
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=35242&d=1589293705
You can see that the talents listed by IQ are sorted alphabetically.
I can make it work by setting the aGroupValueOrder for the "byiq" aListViews in my data_library.lua script to be a literal array of numbers, e.g.: {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"}. But it seems like there should be a way to just make it sort numerically?
Relevant code:
["talent"] = {
["byletter"] = {
sTitleRes = "talent_grouped_title_byletter",
aColumns = {
{ sName = "name", sType = "string", sHeadingRes = "talent_grouped_label_name", nWidth=250 },
{ sName = "iq", sType = "number", sHeadingRes = "talent_grouped_label_iq", nWidth=25 },
},
aFilters = {},
aGroups = { { sDBField = "name", nLength = 1 } },
aGroupValueOrder = { },
},
["byiq"] = {
sTitleRes = "talent_grouped_title_byiq",
aColumns = {
{ sName = "name", sType = "string", sHeadingRes = "talent_grouped_label_name", nWidth=250 },
{ sName = "iq", sType = "number", sHeadingRes = "talent_grouped_label_iq", nWidth=25 },
},
aFilters = {},
aGroups = { { sDBField = "iq" } },
aGroupValueOrder = {},
},
},