简体   繁体   中英

How to implement tooltips for ngx-datatable column header

Im trying to showup simple tooltips on my ngx-datatable-column header. Important is that I can still use the sort functionality.

Somehow "title" is not working.

<ngx-datatable-column title="my Tooltip" [resizeable]="false" [width]="50" name="Name" prop="key" headerClass="text-left">

Where I can integrate the title tag?

    <ngx-datatable #table [rows]="rows" [reorderable]="false" columnMode="force" class="bootstrap table-bordered table-hover" [summaryRow]="true" [summaryPosition]="'bottom'" [loadingIndicator]="showLoadingIndicator" headerHeight="auto" rowHeight="auto" footerHeight="auto" summaryHeight="auto">
        <ngx-datatable-column [resizeable]="false" [width]="50" name="Name" prop="key" headerClass="text-left">
            <ng-template let-value="value" ngx-datatable-cell-template>
                <a href="link" target="_blank" class="text-left">
                    {{value}}
                </a>
            </ng-template>
        </ngx-datatable-column>
</ngx-datatable>

You can use ng-template to set header and tooltip for the header:

<ngx-datatable-column name="Part" headerClass="header" [title]="Hello" 
    [summaryFunc]="emptySumm">
    <ng-template ngx-datatable-header-template let-column="column">
       <span title="the tooltip">I am a tooltip</span>
    </ng-template>
</ngx-datatable-column>

The complete example can be seen at stackblitz.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM