hjalmers / angular-generic-table

A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.

Home Page:https://hjalmers.github.io/angular-generic-table/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

click on elements that is inside of cell

vaydich opened this issue · comments

Hello

I have 5 images that render in loop inside each cell.
How can i listen click of each image but not hole cell?

Take a look at the custom-column example and handle the click event inside your component instead.

The field settings for the column should look something like this:

{
objectKey: 'images',
name: 'Images',
columnComponent: {
    type: ImagesComponent
  }
}

The images component should in turn look something like this:

export class ImagesComponent extends GtCustomComponent<Row> implements OnInit {

	constructor() {
		super();
	}

	ngOnInit() {
		console.log(this.row); // log the row
		console.log(this.column); // log the column
	}
}

I got it. Thx!