【问题标题】:Set title attribute when using ngx-datatable使用 ngx-datatable 时设置标题属性
【发布时间】:2017-09-29 21:48:06
【问题描述】:

我们想使用 title 属性来添加一个工具提示。目前,当您将鼠标悬停在标题上时,标题弹出窗口与标题文本相同。

我发现了其他在表格标题上设置标题属性的示例,这些示例适用于早期版本的 Angular,但我想知道如何使用 ngx-datatable 来做到这一点。

columns = [
  { prop: 'TIME_OF_CALL'      , name: "Time" },
  { prop: 'CALL_STATUS'       , name: "Call Status" },
  { prop: 'CG_PTY_NUM'        , name: "From" },
  { prop: 'ACTUAL_CD_PTY_NUM' , name: "To" },
  { prop: 'COMMON_CD_PTY_NUM' , name: "Common Number" }
];

<ngx-datatable
  class='material'
  [columns]="columns"
  [columnMode]="'force'"
  [headerHeight]="50"
  [footerHeight]="50"
  [rowHeight]="'auto'"
  [limit]="10"
  [rows]='rows'>
</ngx-datatable>

【问题讨论】:

    标签: angular ngx-datatable


    【解决方案1】:

    对我来说,这样的事情确实有效:

    <ngx-datatable-column [flexGrow]="1" prop="TIME_OF_CALL">
                        <ng-template ngx-datatable-header-template let-column="column">
                            <span title="the tooltip">Time</span>
                        </ng-template>
    </ngx-datatable-column>
    

    显然 ngx-datatable-column 不支持 title 属性。此外,当您使用 ng-template 时,没有标题,所以我不得不添加跨度。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多