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












2















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 small snippet of my code:



<mat-table [dataSource]="dataSource"  matSort>
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
<mat-cell *matCellDef="let element">{{element.name}}</mat-cell>
</ng-container>
<ng-container matColumnDef="username">
<mat-header-cell *matHeaderCellDef mat-sort-header>Username</mat-header-cell>
<mat-cell *matCellDef="let element">{{element.username}}</mat-cell>
</ng-container>
<ng-container matColumnDef="email" class="hideOnResponse">
<mat-header-cell *matHeaderCellDef mat-sort-header>Email</mat-header-cell>
<mat-cell *matCellDef="let element">{{element.email}}</mat-cell>
</ng-container>
<ng-container matColumnDef="action">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let element">
<a (click)="editItem(element)" data-toggle="modal" data-target="#editor" matTooltip="Edit" aria-label="tooltip">
<i class="fas fa-pencil-alt"></i>
</a>
<a (click)="deleteItem(element.id)" data-toggle="modal" data-target="#editor" matTooltip="Delete" aria-label="tooltip">
<i class="fas fa-trash-alt"></i>
</a>
</mat-cell>
</ng-container>

<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;" class="element-row" [ccDetailRow]="row" [ccDetailRowTpl]="tpl"></mat-row>
<mat-footer-row *matFooterRowDef="['loading']" [ngClass]="{'hide':dataSource!=null}"></mat-footer-row>
<mat-footer-row *matFooterRowDef="['noData']" [ngClass]="{'hide':!(dataSource!=null && dataSource.data.length==0)}"></mat-footer-row>
</mat-table>
<mat-paginator [pageSizeOptions]="[5, 10, 25, 100]" [pageSize]="5" showFirstLastButtons></mat-paginator>


I've tried doing what was stated on the question linked above but to no avail. Is there any other way?










share|improve this question





























    2















    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 small snippet of my code:



    <mat-table [dataSource]="dataSource"  matSort>
    <ng-container matColumnDef="name">
    <mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
    <mat-cell *matCellDef="let element">{{element.name}}</mat-cell>
    </ng-container>
    <ng-container matColumnDef="username">
    <mat-header-cell *matHeaderCellDef mat-sort-header>Username</mat-header-cell>
    <mat-cell *matCellDef="let element">{{element.username}}</mat-cell>
    </ng-container>
    <ng-container matColumnDef="email" class="hideOnResponse">
    <mat-header-cell *matHeaderCellDef mat-sort-header>Email</mat-header-cell>
    <mat-cell *matCellDef="let element">{{element.email}}</mat-cell>
    </ng-container>
    <ng-container matColumnDef="action">
    <mat-header-cell *matHeaderCellDef></mat-header-cell>
    <mat-cell *matCellDef="let element">
    <a (click)="editItem(element)" data-toggle="modal" data-target="#editor" matTooltip="Edit" aria-label="tooltip">
    <i class="fas fa-pencil-alt"></i>
    </a>
    <a (click)="deleteItem(element.id)" data-toggle="modal" data-target="#editor" matTooltip="Delete" aria-label="tooltip">
    <i class="fas fa-trash-alt"></i>
    </a>
    </mat-cell>
    </ng-container>

    <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
    <mat-row *matRowDef="let row; columns: displayedColumns;" class="element-row" [ccDetailRow]="row" [ccDetailRowTpl]="tpl"></mat-row>
    <mat-footer-row *matFooterRowDef="['loading']" [ngClass]="{'hide':dataSource!=null}"></mat-footer-row>
    <mat-footer-row *matFooterRowDef="['noData']" [ngClass]="{'hide':!(dataSource!=null && dataSource.data.length==0)}"></mat-footer-row>
    </mat-table>
    <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]" [pageSize]="5" showFirstLastButtons></mat-paginator>


    I've tried doing what was stated on the question linked above but to no avail. Is there any other way?










    share|improve this question



























      2












      2








      2








      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 small snippet of my code:



      <mat-table [dataSource]="dataSource"  matSort>
      <ng-container matColumnDef="name">
      <mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
      <mat-cell *matCellDef="let element">{{element.name}}</mat-cell>
      </ng-container>
      <ng-container matColumnDef="username">
      <mat-header-cell *matHeaderCellDef mat-sort-header>Username</mat-header-cell>
      <mat-cell *matCellDef="let element">{{element.username}}</mat-cell>
      </ng-container>
      <ng-container matColumnDef="email" class="hideOnResponse">
      <mat-header-cell *matHeaderCellDef mat-sort-header>Email</mat-header-cell>
      <mat-cell *matCellDef="let element">{{element.email}}</mat-cell>
      </ng-container>
      <ng-container matColumnDef="action">
      <mat-header-cell *matHeaderCellDef></mat-header-cell>
      <mat-cell *matCellDef="let element">
      <a (click)="editItem(element)" data-toggle="modal" data-target="#editor" matTooltip="Edit" aria-label="tooltip">
      <i class="fas fa-pencil-alt"></i>
      </a>
      <a (click)="deleteItem(element.id)" data-toggle="modal" data-target="#editor" matTooltip="Delete" aria-label="tooltip">
      <i class="fas fa-trash-alt"></i>
      </a>
      </mat-cell>
      </ng-container>

      <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
      <mat-row *matRowDef="let row; columns: displayedColumns;" class="element-row" [ccDetailRow]="row" [ccDetailRowTpl]="tpl"></mat-row>
      <mat-footer-row *matFooterRowDef="['loading']" [ngClass]="{'hide':dataSource!=null}"></mat-footer-row>
      <mat-footer-row *matFooterRowDef="['noData']" [ngClass]="{'hide':!(dataSource!=null && dataSource.data.length==0)}"></mat-footer-row>
      </mat-table>
      <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]" [pageSize]="5" showFirstLastButtons></mat-paginator>


      I've tried doing what was stated on the question linked above but to no avail. Is there any other way?










      share|improve this question
















      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 small snippet of my code:



      <mat-table [dataSource]="dataSource"  matSort>
      <ng-container matColumnDef="name">
      <mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
      <mat-cell *matCellDef="let element">{{element.name}}</mat-cell>
      </ng-container>
      <ng-container matColumnDef="username">
      <mat-header-cell *matHeaderCellDef mat-sort-header>Username</mat-header-cell>
      <mat-cell *matCellDef="let element">{{element.username}}</mat-cell>
      </ng-container>
      <ng-container matColumnDef="email" class="hideOnResponse">
      <mat-header-cell *matHeaderCellDef mat-sort-header>Email</mat-header-cell>
      <mat-cell *matCellDef="let element">{{element.email}}</mat-cell>
      </ng-container>
      <ng-container matColumnDef="action">
      <mat-header-cell *matHeaderCellDef></mat-header-cell>
      <mat-cell *matCellDef="let element">
      <a (click)="editItem(element)" data-toggle="modal" data-target="#editor" matTooltip="Edit" aria-label="tooltip">
      <i class="fas fa-pencil-alt"></i>
      </a>
      <a (click)="deleteItem(element.id)" data-toggle="modal" data-target="#editor" matTooltip="Delete" aria-label="tooltip">
      <i class="fas fa-trash-alt"></i>
      </a>
      </mat-cell>
      </ng-container>

      <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
      <mat-row *matRowDef="let row; columns: displayedColumns;" class="element-row" [ccDetailRow]="row" [ccDetailRowTpl]="tpl"></mat-row>
      <mat-footer-row *matFooterRowDef="['loading']" [ngClass]="{'hide':dataSource!=null}"></mat-footer-row>
      <mat-footer-row *matFooterRowDef="['noData']" [ngClass]="{'hide':!(dataSource!=null && dataSource.data.length==0)}"></mat-footer-row>
      </mat-table>
      <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]" [pageSize]="5" showFirstLastButtons></mat-paginator>


      I've tried doing what was stated on the question linked above but to no avail. Is there any other way?







      angular angular-material bootstrap-modal angular-cdk onrowclick






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 8:31







      Foo

















      asked Nov 21 '18 at 8:18









      FooFoo

      115




      115
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Got answer from here. link



          As Will says:




          Try adding $event.stopPropagation() to one of the deeper click
          handlers (like on the cell).




          try doing something similar to this:



          <mat-cell *matCellDef="let group" (click)="$event.stopPropagation()">
          <button mat-button (click)="onDelete(group.id)">
          <mat-icon>delete</mat-icon>
          </button>
          </mat-cell>


          in your case If I'm correct it would be:



                <mat-cell *matCellDef="let element" (click)="$event.stopPropagation()">
          <a (click)="editItem(element)" data-toggle="modal" data-target="#editor" matTooltip="Edit" aria-label="tooltip">
          <i class="fas fa-pencil-alt"></i>
          </a>
          <a (click)="deleteItem(element.id)" data-toggle="modal" data-target="#editor" matTooltip="Delete" aria-label="tooltip">
          <i class="fas fa-trash-alt"></i>
          </a>
          </mat-cell>


          What I had before was that I had edit and delete button in expanded view. I put them in the normal view and added stopPropagation. It worked for me. I am not sure why your modal isn't being open.



          here's code from my project:



          <ng-container matColumnDef="recordDate">
          <th mat-header-cell *matHeaderCellDef mat-sort-header> Record Date </th>
          <td mat-cell *matCellDef="let request" (click)=$event.stopPropagation()> {{request.recDate | date }}
          <button mat-icon-button>
          <mat-icon aria-label="Example icon-button with a heart icon" (click)="openDialog(true, request.requestId)">edit</mat-icon>
          </button>
          <button mat-icon-button>
          <mat-icon aria-label="Example icon-button with a heart icon" (click)="deleteRequest(request.requestId)">delete</mat-icon>
          </button>
          </td>
          </ng-container>





          share|improve this answer


























          • I have tried that but it disables the modal from being displayed.

            – Foo
            Nov 21 '18 at 8:32











          • oh my bad. didn't notice it in your question.

            – Vato
            Nov 21 '18 at 8:41











          • I am exactly the same expandable table and I have edit and delete buttons too. The only difference is that my buttons appear on expanded version of the row. So I don't get the problem. That might not be what you want, but it might be a temporary solution

            – Vato
            Nov 21 '18 at 8:57











          • That actually could work. Thanks.

            – Foo
            Nov 21 '18 at 9:07











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407774%2fangular-material-table-row-click-event-triggered-when-clicking-an-action-in-a%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Got answer from here. link



          As Will says:




          Try adding $event.stopPropagation() to one of the deeper click
          handlers (like on the cell).




          try doing something similar to this:



          <mat-cell *matCellDef="let group" (click)="$event.stopPropagation()">
          <button mat-button (click)="onDelete(group.id)">
          <mat-icon>delete</mat-icon>
          </button>
          </mat-cell>


          in your case If I'm correct it would be:



                <mat-cell *matCellDef="let element" (click)="$event.stopPropagation()">
          <a (click)="editItem(element)" data-toggle="modal" data-target="#editor" matTooltip="Edit" aria-label="tooltip">
          <i class="fas fa-pencil-alt"></i>
          </a>
          <a (click)="deleteItem(element.id)" data-toggle="modal" data-target="#editor" matTooltip="Delete" aria-label="tooltip">
          <i class="fas fa-trash-alt"></i>
          </a>
          </mat-cell>


          What I had before was that I had edit and delete button in expanded view. I put them in the normal view and added stopPropagation. It worked for me. I am not sure why your modal isn't being open.



          here's code from my project:



          <ng-container matColumnDef="recordDate">
          <th mat-header-cell *matHeaderCellDef mat-sort-header> Record Date </th>
          <td mat-cell *matCellDef="let request" (click)=$event.stopPropagation()> {{request.recDate | date }}
          <button mat-icon-button>
          <mat-icon aria-label="Example icon-button with a heart icon" (click)="openDialog(true, request.requestId)">edit</mat-icon>
          </button>
          <button mat-icon-button>
          <mat-icon aria-label="Example icon-button with a heart icon" (click)="deleteRequest(request.requestId)">delete</mat-icon>
          </button>
          </td>
          </ng-container>





          share|improve this answer


























          • I have tried that but it disables the modal from being displayed.

            – Foo
            Nov 21 '18 at 8:32











          • oh my bad. didn't notice it in your question.

            – Vato
            Nov 21 '18 at 8:41











          • I am exactly the same expandable table and I have edit and delete buttons too. The only difference is that my buttons appear on expanded version of the row. So I don't get the problem. That might not be what you want, but it might be a temporary solution

            – Vato
            Nov 21 '18 at 8:57











          • That actually could work. Thanks.

            – Foo
            Nov 21 '18 at 9:07
















          0














          Got answer from here. link



          As Will says:




          Try adding $event.stopPropagation() to one of the deeper click
          handlers (like on the cell).




          try doing something similar to this:



          <mat-cell *matCellDef="let group" (click)="$event.stopPropagation()">
          <button mat-button (click)="onDelete(group.id)">
          <mat-icon>delete</mat-icon>
          </button>
          </mat-cell>


          in your case If I'm correct it would be:



                <mat-cell *matCellDef="let element" (click)="$event.stopPropagation()">
          <a (click)="editItem(element)" data-toggle="modal" data-target="#editor" matTooltip="Edit" aria-label="tooltip">
          <i class="fas fa-pencil-alt"></i>
          </a>
          <a (click)="deleteItem(element.id)" data-toggle="modal" data-target="#editor" matTooltip="Delete" aria-label="tooltip">
          <i class="fas fa-trash-alt"></i>
          </a>
          </mat-cell>


          What I had before was that I had edit and delete button in expanded view. I put them in the normal view and added stopPropagation. It worked for me. I am not sure why your modal isn't being open.



          here's code from my project:



          <ng-container matColumnDef="recordDate">
          <th mat-header-cell *matHeaderCellDef mat-sort-header> Record Date </th>
          <td mat-cell *matCellDef="let request" (click)=$event.stopPropagation()> {{request.recDate | date }}
          <button mat-icon-button>
          <mat-icon aria-label="Example icon-button with a heart icon" (click)="openDialog(true, request.requestId)">edit</mat-icon>
          </button>
          <button mat-icon-button>
          <mat-icon aria-label="Example icon-button with a heart icon" (click)="deleteRequest(request.requestId)">delete</mat-icon>
          </button>
          </td>
          </ng-container>





          share|improve this answer


























          • I have tried that but it disables the modal from being displayed.

            – Foo
            Nov 21 '18 at 8:32











          • oh my bad. didn't notice it in your question.

            – Vato
            Nov 21 '18 at 8:41











          • I am exactly the same expandable table and I have edit and delete buttons too. The only difference is that my buttons appear on expanded version of the row. So I don't get the problem. That might not be what you want, but it might be a temporary solution

            – Vato
            Nov 21 '18 at 8:57











          • That actually could work. Thanks.

            – Foo
            Nov 21 '18 at 9:07














          0












          0








          0







          Got answer from here. link



          As Will says:




          Try adding $event.stopPropagation() to one of the deeper click
          handlers (like on the cell).




          try doing something similar to this:



          <mat-cell *matCellDef="let group" (click)="$event.stopPropagation()">
          <button mat-button (click)="onDelete(group.id)">
          <mat-icon>delete</mat-icon>
          </button>
          </mat-cell>


          in your case If I'm correct it would be:



                <mat-cell *matCellDef="let element" (click)="$event.stopPropagation()">
          <a (click)="editItem(element)" data-toggle="modal" data-target="#editor" matTooltip="Edit" aria-label="tooltip">
          <i class="fas fa-pencil-alt"></i>
          </a>
          <a (click)="deleteItem(element.id)" data-toggle="modal" data-target="#editor" matTooltip="Delete" aria-label="tooltip">
          <i class="fas fa-trash-alt"></i>
          </a>
          </mat-cell>


          What I had before was that I had edit and delete button in expanded view. I put them in the normal view and added stopPropagation. It worked for me. I am not sure why your modal isn't being open.



          here's code from my project:



          <ng-container matColumnDef="recordDate">
          <th mat-header-cell *matHeaderCellDef mat-sort-header> Record Date </th>
          <td mat-cell *matCellDef="let request" (click)=$event.stopPropagation()> {{request.recDate | date }}
          <button mat-icon-button>
          <mat-icon aria-label="Example icon-button with a heart icon" (click)="openDialog(true, request.requestId)">edit</mat-icon>
          </button>
          <button mat-icon-button>
          <mat-icon aria-label="Example icon-button with a heart icon" (click)="deleteRequest(request.requestId)">delete</mat-icon>
          </button>
          </td>
          </ng-container>





          share|improve this answer















          Got answer from here. link



          As Will says:




          Try adding $event.stopPropagation() to one of the deeper click
          handlers (like on the cell).




          try doing something similar to this:



          <mat-cell *matCellDef="let group" (click)="$event.stopPropagation()">
          <button mat-button (click)="onDelete(group.id)">
          <mat-icon>delete</mat-icon>
          </button>
          </mat-cell>


          in your case If I'm correct it would be:



                <mat-cell *matCellDef="let element" (click)="$event.stopPropagation()">
          <a (click)="editItem(element)" data-toggle="modal" data-target="#editor" matTooltip="Edit" aria-label="tooltip">
          <i class="fas fa-pencil-alt"></i>
          </a>
          <a (click)="deleteItem(element.id)" data-toggle="modal" data-target="#editor" matTooltip="Delete" aria-label="tooltip">
          <i class="fas fa-trash-alt"></i>
          </a>
          </mat-cell>


          What I had before was that I had edit and delete button in expanded view. I put them in the normal view and added stopPropagation. It worked for me. I am not sure why your modal isn't being open.



          here's code from my project:



          <ng-container matColumnDef="recordDate">
          <th mat-header-cell *matHeaderCellDef mat-sort-header> Record Date </th>
          <td mat-cell *matCellDef="let request" (click)=$event.stopPropagation()> {{request.recDate | date }}
          <button mat-icon-button>
          <mat-icon aria-label="Example icon-button with a heart icon" (click)="openDialog(true, request.requestId)">edit</mat-icon>
          </button>
          <button mat-icon-button>
          <mat-icon aria-label="Example icon-button with a heart icon" (click)="deleteRequest(request.requestId)">delete</mat-icon>
          </button>
          </td>
          </ng-container>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 21 '18 at 9:05

























          answered Nov 21 '18 at 8:28









          VatoVato

          6142633




          6142633













          • I have tried that but it disables the modal from being displayed.

            – Foo
            Nov 21 '18 at 8:32











          • oh my bad. didn't notice it in your question.

            – Vato
            Nov 21 '18 at 8:41











          • I am exactly the same expandable table and I have edit and delete buttons too. The only difference is that my buttons appear on expanded version of the row. So I don't get the problem. That might not be what you want, but it might be a temporary solution

            – Vato
            Nov 21 '18 at 8:57











          • That actually could work. Thanks.

            – Foo
            Nov 21 '18 at 9:07



















          • I have tried that but it disables the modal from being displayed.

            – Foo
            Nov 21 '18 at 8:32











          • oh my bad. didn't notice it in your question.

            – Vato
            Nov 21 '18 at 8:41











          • I am exactly the same expandable table and I have edit and delete buttons too. The only difference is that my buttons appear on expanded version of the row. So I don't get the problem. That might not be what you want, but it might be a temporary solution

            – Vato
            Nov 21 '18 at 8:57











          • That actually could work. Thanks.

            – Foo
            Nov 21 '18 at 9:07

















          I have tried that but it disables the modal from being displayed.

          – Foo
          Nov 21 '18 at 8:32





          I have tried that but it disables the modal from being displayed.

          – Foo
          Nov 21 '18 at 8:32













          oh my bad. didn't notice it in your question.

          – Vato
          Nov 21 '18 at 8:41





          oh my bad. didn't notice it in your question.

          – Vato
          Nov 21 '18 at 8:41













          I am exactly the same expandable table and I have edit and delete buttons too. The only difference is that my buttons appear on expanded version of the row. So I don't get the problem. That might not be what you want, but it might be a temporary solution

          – Vato
          Nov 21 '18 at 8:57





          I am exactly the same expandable table and I have edit and delete buttons too. The only difference is that my buttons appear on expanded version of the row. So I don't get the problem. That might not be what you want, but it might be a temporary solution

          – Vato
          Nov 21 '18 at 8:57













          That actually could work. Thanks.

          – Foo
          Nov 21 '18 at 9:07





          That actually could work. Thanks.

          – Foo
          Nov 21 '18 at 9:07




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407774%2fangular-material-table-row-click-event-triggered-when-clicking-an-action-in-a%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini