question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add click event to table row

See original GitHub issue

I’m submitting a … (check one with “x”)

[ ] bug report => search github for a similar issue or PR before submitting
[x ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior There is no option to configure a click event on row.

Expected behavior Add a click event to table row with the possibility of associate a function, for example, to navigate to a detail page.

Reproduction of the problem N/A

What is the motivation / use case for changing the behavior? N/A

Please tell us about your environment: Ubuntu 16.04, Intellij Ultimate Idea 2017.2.5, angular-cli 1.5.0

  • Table version: 11.1.3
  • Angular version: 5.0.1
  • Browser: Chrome Version 62.0.3202.94 (Official Build) (64-bit)
  • Language: TypeScript 2.4.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

39reactions
karansharma27commented, Dec 31, 2018

Just use (activate)=“onActivate($event)” property on ngx-datatable tag.

Then in TS file, use this method

onActivate(event) {
    if(event.type == 'click') {
        console.log(event.row);
    }
}
39reactions
sharkomancommented, Aug 17, 2018

very bad documentation not helping at all

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding an onclick event to a table row - Stack Overflow
Something like this. function addRowHandlers() { var table = document.getElementById("tableId"); var rows = table.
Read more >
javascript add on click event on table rows - Codexpedia
The javascript function that adds on click event on each row in the table. The function takes the table id as the parameter...
Read more >
Javascript Element How to - Handle click event for table row tr
We would like to know how to handle click event for table row tr. Answer. <!DOCTYPE html> <html> ...
Read more >
Add onClick handler to table rows and return column values of ...
Add onClick handler to table rows and return column values of clicked rows using both jQuery and JavascriptMore samples · jQuery Table ·...
Read more >
How to make clickable table row Without adding OnClick to ...
1) Add a custom class to the table widget (jsClass) · 2) Define OnRender event handler to the respective screen · 3) Within...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found