Ryan123 Posted February 7, 2016 Posted February 7, 2016 function searchMission() local text = guiGetText(SearchEdit) local sItems = { } for i, v in pairs(Mission) do if not (text == "" ) then if (string.find(string.upper(v[1]), string.upper(text), 1, true)) then table.insert(sItems, v[1]) end else table.insert(sItems, v[1]) end end guiGridListClear(ChooseEvent) for i, v in pairs(sItems) do local row = guiGridListAddRow(ChooseEvent) guiGridListSetItemText(ChooseEvent, row, 1, v, false, false) end end I tested with 1 column and is working and when I put with 2 column, still work but other collumn don't have anything. There's the image, Image2. Is missing second column.
Tomas Posted February 7, 2016 Posted February 7, 2016 You're clearing the whole gridlist and only setting the text of first column, that's why.
KariiiM Posted February 8, 2016 Posted February 8, 2016 function searchMission() local text = guiGetText(SearchEdit) local sItems = { } for i, v in pairs(Mission) do if not (text == "" ) then if (string.find(string.upper(v[1]), string.upper(text), 1, true)) then table.insert(sItems, v[1]) end else table.insert(sItems, v[1]) end end guiGridListClear(ChooseEvent) for i, v in pairs(sItems) do local row, col = guiGridListAddRow(ChooseEvent) guiGridListSetItemText(ChooseEvent, row, 1, v[1], false, false) guiGridListSetItemText(ChooseEvent, row, 2, v[2], false, false) end end
Ryan123 Posted February 8, 2016 Author Posted February 8, 2016 Isn't working, check this image http://imgur.com/Tr4GSKM
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now