KariiiM Posted August 3, 2015 Share Posted August 3, 2015 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 Link to comment
JR10 Posted August 3, 2015 Share Posted August 3, 2015 onClientGUIClick > guiGridListSetSelectedItem(gridlist, 0, 0)?? If not, please explain better. Link to comment
KariiiM Posted August 3, 2015 Author Share Posted August 3, 2015 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. Link to comment
HUNGRY:3 Posted August 3, 2015 Share Posted August 3, 2015 (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 August 3, 2015 by Guest Link to comment
KariiiM Posted August 3, 2015 Author Share Posted August 3, 2015 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 Link to comment
HUNGRY:3 Posted August 3, 2015 Share Posted August 3, 2015 lol look if guiGridListGetItemText (yourgrid, row, col) == "nameoftherowgrid" then -- if this is selected guiGridListRemoveRow(yourgrid,nameoftherowgrid) -- nameoftherowgrid -- will be removed Link to comment
GTX Posted August 4, 2015 Share Posted August 4, 2015 Do you want to remove selected row? guiGridListRemoveRow(grid, guiGridListGetSelectedItem(grid)) Or remove row based on index from your table? guiGridListRemoveRow(grid, INDEX) Link to comment
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