Controlled Posted June 23, 2014 Posted June 23, 2014 Is it possible to have a onClientGUIClick for when they select a item in the gridlist?
Max+ Posted June 23, 2014 Posted June 23, 2014 i didn't get what you want , you want if player click on gridlist get the selected item that he clicked on ?
Controlled Posted June 23, 2014 Author Posted June 23, 2014 If they click on something in the list, it will call a function right away which in turn will load more information to display off to the side about what I have selected. The main part is getting the function to trigger just by clicking on the glidlist item.
xXMADEXx Posted June 23, 2014 Posted June 23, 2014 Yes.. Here is a little example that I made local g = guiCreateGridList ( 0, 0, 100, 100, false ) guiGridListAddColumn ( g, "Column", 1 ) for i=1, 100 do local r = guiGridListAddRow ( g ) guiGridListSetItemText ( g, r, 1, tostring ( i ), false, false ) end addEventHandler ( "onClientGUIClick", g, function ( ) local r, c = guiGridListGetSelectedItem ( source ) outputChatBox ( "You selected ".. tostring ( guiGridListGetItemText ( g, r, 1 ) ) ) end )
Controlled Posted June 24, 2014 Author Posted June 24, 2014 Yes.. Here is a little example that I made local g = guiCreateGridList ( 0, 0, 100, 100, false ) guiGridListAddColumn ( g, "Column", 1 ) for i=1, 100 do local r = guiGridListAddRow ( g ) guiGridListSetItemText ( g, r, 1, tostring ( i ), false, false ) end addEventHandler ( "onClientGUIClick", g, function ( ) local r, c = guiGridListGetSelectedItem ( source ) outputChatBox ( "You selected ".. tostring ( guiGridListGetItemText ( g, r, 1 ) ) ) end ) Thanks!
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