JSTable icon indicating copy to clipboard operation
JSTable copied to clipboard

on click doesnt work

Open bobmanc opened this issue 3 years ago • 3 comments

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

bobmanc avatar Sep 20 '22 22:09 bobmanc

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

Trekky12 avatar Sep 21 '22 15:09 Trekky12

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.

bobmanc avatar Sep 21 '22 16:09 bobmanc

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 avatar Sep 21 '22 17:09 Trekky12