Jump to content

guiGridList removing selection


KariiiM

Recommended Posts

Posted

Hey guys,

Anyone know which function can i use to remove the selection of an row when i hit another GridList? I am using 2 Tables and adding GridList in each table but when i selecte to buy item from second GridList it buy from the first grid and second one.

Thanks in advance

Posted
onClientGUIClick > guiGridListSetSelectedItem(gridlist, 0, 0)?? If not, please explain better.

Well, im scripting a simple shop ,using tables and guiGridLists ,But when i selecte an item in Table 1 then i go to Table 2 to buy something from this table, After clicking on buy button i buy from Table 1 & 2 in same time i mean all selected gridlists, i want if i selected the gridlist or clicked on another table the first selected item be removed.

Posted (edited)

maybe this?

function clicked () 
local row, col = guiGridListGetSelectedItem (yourgrid) 
if source == yourgrid then 
if guiGridListGetItemText (yourgrid, row, col) == "nameoftherowgrid" then 
guiGridListRemoveRow(yourgrid,nameoftherowgrid) 
end 
end 
end 
addEventHandler("onClientGUIClick", root, clicked) 
  

Edited by Guest
2vjs7it.jpg
Posted
maybe this?
function clicked () 
local row, col = guiGridListGetSelectedItem (yourgrid) 
if source == yourgrid then 
if guiGridListGetItemText (yourgrid, row, col) == "nameoftherowgrid" then 
guiGridListRemoveRow(yourgrid,nameoftherowgrid2) 
end 
end 
end 
addEventHandler("onClientGUIClick", root, clicked) 
  

This function just remove rows not selected rows :P

Posted

lol look

  
if guiGridListGetItemText (yourgrid, row, col) == "nameoftherowgrid" then -- if this is selected 
guiGridListRemoveRow(yourgrid,nameoftherowgrid) -- nameoftherowgrid -- will be removed 
  

2vjs7it.jpg
Posted

Do you want to remove selected row?

guiGridListRemoveRow(grid, guiGridListGetSelectedItem(grid)) 

Or remove row based on index from your table?

guiGridListRemoveRow(grid, INDEX) 

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast

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