Skip to content

How to add a click event to a table row? #558

Closed Answered by Arbureva
Arbureva asked this question in Q&A
Discussion options

You must be logged in to vote

I've come up with an alternative at the moment, so if there's a better way, I hope someone will let me know, thanks~

wiget := g.TableRow(
			g.Layout{
				g.Checkbox(user.Name, &model.Users[i].IsSelect).OnChange(func() {
					ChangeUsers(i)
				}),
			},
			g.Layout{
				g.Selectablef("%v", user.ID),
				g.Event().OnClick(g.MouseButtonLeft, func() {
					fmt.Println("clicked")
				}),
			},
		)
		list = append(list, wiget)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Arbureva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant