So I've been making a lot of progress on the look and feel of the whole thing. However, I tried making a filter for the list (checkboxes for each class). On click, it runs the update function omitting any classes unchecked. It works perfectly... Until the list gets smaller than the rows displayed... Then the whole frame disappears as if it was hidden. Any insight on what may cause that?
I have SetText("") to simply clear out the text of any rows that go beyond the number of entries (27 rows total, if there's only 25 entries in the WorkingTable then it should blank out the last 2 lines... or so I thought).
Lua Code:
function DKPTable_Update(self)
local numOptions;
local index, row
local offset = FauxScrollFrame_GetOffset(core.DKPTable)
local classFiltered = {};
core.WorkingTable = {}
for k,v in pairs(classes) do
if (core.ConfigTab1.checkBtn[k]:GetChecked() == true) then
classFiltered[v] = true;
else
classFiltered[v] = false;
end
end
for k,v in pairs(DKP_DKPTable) do
if(classFiltered[DKP_DKPTable[k]["class"]] == true) then
tinsert(core.WorkingTable, v)
end
end
numOptions = #core.WorkingTable;
for i=1, core.TableNumrows do
index = offset + i
row = core.DKPTable.Rows[i]
if (i <= numOptions) then
local c = GetCColors(core.WorkingTable[index].class);
row.DKPInfo[1].data:SetText(core.WorkingTable[index].player)
row.DKPInfo[1].data:SetTextColor(c.r, c.g, c.b, 1)
row.DKPInfo[2].data:SetText("N/A")
row.DKPInfo[3].data:SetText(core.WorkingTable[index].dkp)
row.DKPInfo[3].adjusted:SetText("("..core.WorkingTable[index].dkp - core.WorkingTable[index].previous_dkp..")");
else
row.DKPInfo[1].data:SetText("")
row.DKPInfo[2].data:SetText("")
row.DKPInfo[3].data:SetText("")
row.DKPInfo[3].adjusted:SetText("");
end
if (index == SelectedData) then
row:SetNormalTexture("Interface\\BUTTONS\\UI-Listbox-Highlight2.blp")
else
row:SetNormalTexture(nil)
end
if core.WorkingTable[index] then
row:Show()
row.index = index
else
row:Hide()
end
end
FauxScrollFrame_Update(core.DKPTable, numOptions, core.TableNumrows, core.TableHeight)
end
EDIT: I have tried reactively adjusting core.TableNumrows (number of rows to draw) based on numOptions (number of entries in the table).. But that doesn't seem to effect anything