ngx-datatable icon indicating copy to clipboard operation
ngx-datatable copied to clipboard

Row data on cell click

Open alceucardoso opened this issue 7 years ago • 4 comments

[ ] 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

Hi,

When i set click event on table and pass $event as parameter i can't get data from clicked row.

There is a forecast to implement it?

<ngx-datatable ... (click)="detail($event)">

I want to invoke details page when click over row but i'm using checkbox selection from ngx-datatable.

I'm using ngx-datatable version 9.3.1 and angular 4.3.5.

alceucardoso avatar Aug 29 '17 19:08 alceucardoso

Use activate event binding instead of click in HTML (activate)='onUserEvent($event) for any user events. In the ts file

onUserEvent ( e ) {
        if ( e.type == "click" ) {
            console.log(e.row);
        }
    } 

anthonysubramani avatar Sep 05 '17 11:09 anthonysubramani

html: <ngx-datatable-column name="IsEnable" [width]="10"> <ng-template let-row="row" ngx-datatable-cell-template> <mat-slide-toggle (click)="slideClick(row)" [checked]="row.isEnable">{{row.isEnable}}

ts: slideClick(row:any) { console.log("slideClick_row111:",row); }

XimenaWang avatar Nov 08 '17 09:11 XimenaWang

Use activate event binding instead of click in HTML (activate)='onUserEvent($event) for any user events. In the ts file

onUserEvent ( e ) {
        if ( e.type == "click" ) {
            console.log(e.row);
        }
    } 

Nice Job man...thanks

rhaymisonbetini avatar Nov 25 '19 14:11 rhaymisonbetini

Use activate event binding instead of click in HTML (activate)='onUserEvent($event) for any user events. In the ts file

onUserEvent ( e ) {
        if ( e.type == "click" ) {
            console.log(e.row);
        }
    } 

solution works well for me. but for e.type="keydown" I am getting previous selected row data. any idea how to get selected cell data?

richa0312 avatar Aug 31 '22 20:08 richa0312