Ngx-datatable: Row data on cell click

Created on 29 Aug 2017  路  3Comments  路  Source: swimlane/ngx-datatable

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

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.

Most helpful comment

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);
        }
    } 

All 3 comments

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);
        }
    } 

html:


{{row.isEnable}}

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Matthi0uw picture Matthi0uw  路  3Comments

JanStock picture JanStock  路  3Comments

IngoManthey picture IngoManthey  路  3Comments

Caballerog picture Caballerog  路  4Comments

paritosh64ce picture paritosh64ce  路  3Comments