Jump to content

[help]Search bug


Ryan123

Recommended Posts

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.

Link to comment
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 
  

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...