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.

Prevent selection of the row when any button click in a row

See original GitHub issue

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

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

Current behavior When any button clicked in any cell it also selects the row. Eg: Image

Expected behavior There should be a callback where we can determine that a particular button is clicked on that basis we can prevent the row selection. currently there is a property [selectCheck] which takes a function with argument of the row checkSelectable(event) it should have the actual event as well like: checkSelectable($event, row) from the event we can detect which dom is clicked ?

Reproduction of the problem Add a custom column name it action in that column add <button> now if you click that button it will select that row.

Please tell us about your environment: Ubuntu, WebStorm

  • Table version: ^7.1.1

  • Angular version: 4x

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

16reactions
artipixelcommented, Feb 8, 2018

I’ve tried to figure out a solution for myself, here is what I did:

In component.ts

  clickStopper(event) {
      event.stopPropagation();
      return;
  }

In component.html

<button class="inline_action" (click)="clickStopper($event)">DO THE STUFF</button>
9reactions
Krticcommented, Oct 11, 2017

use event.stopPropagation(); within your click method

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent the row to be selected when I click the button ...
When I click the button in the custom table column the row where the button belongs gets selected. Is it possible to avoid...
Read more >
Prevent table row onclick event to fire when clicking button ...
This was the answer I needed as the onclick method I was calling called other methods and event.stopPropagation(); stopped them being called as...
Read more >
How to prevent row select during click event? - jQWidgets
You could try to use the “unselectRow” method. I read that 'marks' about the unselect method but this method has arguments and you...
Read more >
Is it possible to disable the selected row on button click?
At this point you cannot edit row value, only perform actions on column with buttons, icon buttons etc so only these action buttons...
Read more >
Prevent Row Selection when GridCommandColumn button is ...
We have validated your query and you want prevent the row selection while clicking command column button. You can achieve your requirement ...
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