簡體   English   中英

如何在 Angular 8 的 ngx-datatable 中的列中添加按鈕?

[英]How can i add button to a column in a ngx-datatable in Angular 8?

此 HTML 代碼對我不起作用。

<ngx-datatable-column name="Option" prop="option" [draggable]="false" [resizeable]="false 
         [width]="250">
      <span>
        <button class="optionButton" type="button" data-toggle="modal" data- 
        target="#addOption">Reserve Product</button>
      </span>
</ngx-datatable-column>

將按鈕保留在<ng-template>

像這樣嘗試:

<ngx-datatable-column name="Option" prop="option" [draggable]="false" [resizeable]="false 
     [width]="250">
    <ng-template ngx-datatable-cell-template let-value="value">
        <span>
            <button class="optionButton" type="button" data-toggle="modal" data- 
    target="#addOption">Reserve Product</button>
         </span>
    </ng-template>
</ngx-datatable-column>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM