• Search a DListView?
    3 replies, posted
Hey guys, is it possible to make a tiny search bar for a DListView? [code] local plylist = vgui.Create("DListView", mainpanel) plylist:SetParent(mainpanel) plylist:SetPos(10, 300) plylist:SetSize(200, 125) plylist:SetMultiSelect(false) local clmColumn1 = plylist:AddColumn("Name") clmColumn1:SetMinWidth(200) clmColumn1:SetMaxWidth(200) for k,v in pairs(player.GetAll()) do plylist:AddLine(v:Nick()) -- Add lines end -- The code in theory local search = vgui.Create( "DTextEntry", mainpanel ) search:SetPos( 25, 125 ) search:SetSize( 200, 45 ) search:SetText( "Put person's name here" ) search.OnTextChanged = function( checkply ) // do something in the DList to filter results // Loop to keep it always up to date end [/code]
What's the DListView for?
[QUOTE=xbeastguyx;49756596]What's the DListView for?[/QUOTE] Listing all players and then from there I pull their playermodel. I want the search to filter out players starting with the first variable - until the user stops (max 20 characters)
[url]http://wiki.garrysmod.com/page/DTextEntry/OnValueChange[/url] should help, update your list choosing all players having blah in the name.
Sorry, you need to Log In to post a reply to this thread.