Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Table): add click event for the entire row <tr> #353

Merged
merged 6 commits into from
Jul 17, 2023

Conversation

9uenther
Copy link
Contributor

@9uenther 9uenther commented Jun 27, 2023

Resolves #410

click function like on the Dropdown

click function like on the Dropdown
@vercel
Copy link

vercel bot commented Jun 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview Jul 12, 2023 1:13pm

@vercel
Copy link

vercel bot commented Jun 27, 2023

@9uenther is attempting to deploy a commit to the Nuxt Labs Team on Vercel.

A member of the Team first needs to authorize it.

@Haythamasalama
Copy link
Contributor

Haythamasalama commented Jun 27, 2023

This is very useful. I have used it a lot before to show a sub table with different data or trigger an event when clicking on a table row.

Copy link
Member

Still thinking of what would be the option here, either passing a click function in each item or having a global click like you did in your first PR.

@9uenther
Copy link
Contributor Author

I prefer the click function in each element, it is very flexible and sometimes better than the global callback.

@Haythamasalama
Copy link
Contributor

Still thinking of what would be the option here, either passing a click function in each item or having a global click like you did in your first PR.

The use case I used before was global click, but it's good for each item.

@nuxt-studio
Copy link

nuxt-studio bot commented Jun 29, 2023

Live Preview ready!

Name Edit Preview Latest Commit
ui Edit on Studio ↗︎ View Live Preview 148530b

@benjamincanac
Copy link
Member

I've added an example in the docs, let me know what you think 😊

@jaybharadia
Copy link
Contributor

Can you please share the screenshot @9uenther.

Question

  • Is it necessary to pass click prop in each row ? Any other alternative like passing click handler in one place instead of passing it in all the row items ?

@benjamincanac
Copy link
Member

I've changed my mind on this and made a @select listener instead of passing a click function to all of the rows. Let me know what you think!

@benjamincanac benjamincanac merged commit d292706 into nuxt:dev Jul 17, 2023
@clopezpro
Copy link
Contributor

You can add event sort? It is necessary to order large data and send as a parameter to the endpoint

Copy link
Member

You can add event sort? It is necessary to order large data and send as a parameter to the endpoint

Is an issue not already open for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UTable : support clickable row, emit value
5 participants