Jump to content

Help , in Code Search in Gridlist


LoOs

Recommended Posts

Hello

I put in the panel edit and gridlist

And the role of research in the edit gridlist

I tried to do the piece using string.find

But that does not work and some of the figures shows a list of times

But the text does not appear

I extracted the table from xml

Search in gridlist table

Code: #

function loadHandling (radia, names, st) 
    stationsNames = names 
    stations = st 
for i,v in ipairs(stationsNames) do 
        local row = guiGridListAddRow(handling_grid) 
    guiGridListSetItemText(handling_grid,row,handling_column2,""..i.."",false,false) 
    guiGridListSetItemText(handling_grid,row,handling_column2,v[1],false,false) 
    guiGridListSetItemData(handling_grid,row,handling_column, v[2]) 
    guiGridListSetItemColor(handling_grid,row,handling_column2,255,0,0) 
    guiGridListSetItemColor(handling_grid,row,handling_column,0,255,10) 
end 
end 
  
addEventHandler("onClientGUIChanged",root, 
    function (radia, names, st) 
        stationsNames = names 
    stations = st 
        if ( source == handling_editsearch ) then 
            local text = guiGetText(handling_editsearch) 
            if ( text == "" ) then 
                loadHandling() 
            else 
                guiGridListClear(handling_grid) 
                for i,v in ipairs(stationsNames) do 
       if string.find(string.upper(name),string.upper(guiGetText(handling_editsearch))) then 
                        local row = guiGridListAddRow(handling_grid) 
                        guiGridListSetItemText(handling_grid,row,handling_column2,v[1],false,false) 
                        guiGridListSetItemText(handling_grid,row,handling_column,v[2],false,false) 
                    end 
                end 
            end 
        end 
    end 
) 

and , Thanks , :D

Link to comment
  • Other Languages Moderators

Your code is nonsense.

From where you come up with those parameters?

function loadHandling (radia, names, st) 

You didn't pass anything:

loadHandling() 

And again from where you come up with those parameters? this event don't have those parameters.

addEventHandler("onClientGUIChanged",root, 
    function (radia, names, st) 

I can't see why you doing this over and over.

stationsNames = names 
stations = st 

radia not used anywhere.

name not defined here:

if string.find(string.upper(name),string.upper(guiGetText(handling_editsearch))) then 

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...