【问题标题】:How can i add button to a column in a ngx-datatable in Angular 8?如何在 Angular 8 的 ngx-datatable 的列中添加按钮?
【发布时间】:2019-12-28 17:22:46
【问题描述】:

此 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>

【问题讨论】:

  • 查看此来源code

标签: html css angular angular8 ngx-datatable


【解决方案1】:

将按钮保持在&lt;ng-template&gt;

试试这样:

<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>

【讨论】:

    猜你喜欢
    • 2020-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-28
    相关资源
    最近更新 更多