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

on click doesnt work #29

Open
bobmanc opened this issue Sep 20, 2022 · 3 comments
Open

on click doesnt work #29

bobmanc opened this issue Sep 20, 2022 · 3 comments
Labels
question Further information is requested

Comments

@bobmanc
Copy link

bobmanc commented Sep 20, 2022

When I do this nothing happens.
myTable.on("click", function () { console.log('clicked'); });

@Trekky12
Copy link
Collaborator

What exactly is your use case for clicking on the table?

@bobmanc
Copy link
Author

bobmanc commented Sep 21, 2022

If I bring a list of users back from the server the list has a subset of data like first name, last name. If I click on a row I can bring up a dialog with all the details so it can be edited and saved. I use this functionality all the time in my webapps.

@Trekky12
Copy link
Collaborator

Thank you for your explanation. I get your use case and would like to propose a solution for it (that's how I do it).

First return a table cell with the handler for the user (e.g. a link or icon) similar to the issue #22. You can here define custom data attributes or class names.
Afterwards it is possible to listen for click events on the document and detect if the click was on your element (also like in issue #22 described).

Is this working for you? Otherwise feel free to submit a pull request for your feature.

@Trekky12 Trekky12 added the question Further information is requested label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants