LoOs Posted August 19, 2015 Posted August 19, 2015 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 ,
DNL291 Posted August 20, 2015 Posted August 20, 2015 Make sure that 'name' doesn't returns a nil value. See what debugmode shows (with /debugscript 3).
LoOs Posted August 20, 2015 Author Posted August 20, 2015 local name = v[1] debugscript , GridList , in Search Edit , debugscript GridList and , Thanks
TAPL Posted August 20, 2015 Posted August 20, 2015 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
LoOs Posted August 21, 2015 Author Posted August 21, 2015 problems have Fixed but also did not work! + Table in the xml file
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