Hello everyone!
Im currently having a small problem. Basically i have a DListView thats fetching data from a database. When the user right clicks a row, He is able to copy that line, However using
[CODE]Line:GetColumnText(index)[/CODE]
Is only returning that one result of course, So i was wandering what would be the best way to get the data from the line into a table? Is there a function i can use that can return my number of columns for the upper bound of a for loop? using
[CODE]Line:GetTable()[/CODE]
Also doesnt work due to it being a type userdata.
So whats the best way to go about this? Heres my code, with a small attempt that i know doesn't work:
[CODE]function statsList:OnRowRightClick(LineID, Line)
local x, y = gui.MousePos()
local rightMenu = vgui.Create("DMenu")
rightMenu:AddOption("Add points")
rightMenu:AddOption("Copy Line", function()
local testString = string.Implode(",",Line:GetTable())
SetClipboardText(testString)
ply:ChatPrint("Line has been copied to clipboard")
end
)
rightMenu:Open()
end[/CODE]
Thanks in advance!
Sorry, you need to Log In to post a reply to this thread.