onrowclick

Angular Material table row (click) event triggered when clicking an action in a cell within that row

醉酒当歌 提交于 2019-12-10 19:33:11
问题 How can you trigger a modal with a button inside a mat-table without triggering the rows (click) event? I've seen and read with Angular Material 2 Table Mat Row Click event also called with button click in Mat Cell however the solution of using $event.stopPropagation() there prevents the modal from being displayed. I followed this https://stackblitz.com/edit/angular-material2-expandable-rows-filter-pagination-sorting?file=app%2Ftable-example.html for the row expansion functionality. Here's a

Angular Material 2 Table Mat Row Click event also called with button click in Mat Cell

走远了吗. 提交于 2019-11-27 01:50:26
问题 I am new to material 2 and I have implemented mat table and in which I have click event on row to open dialog and there is also a menu button in last column "Action" but on clicking on button it also open dialog box instead of opening menu. Table <mat-table #table [dataSource]="dataSource" matSort (matSortChange)="sortData($event)"> <ng-container matColumnDef="id"> <mat-header-cell *matHeaderCellDef > No. </mat-header-cell> <mat-cell *matCellDef="let element"> <mat-checkbox checked='true'><