Is it possible to add a tooltip to a column title in a ng2-smart-table?
We are using "ng2-smart-table": "1.4.0", "@angular/core": "7.2.16"
We have a tooltipComponent, below, this works great on the cell, we want to have the tooltip display when the user hover's over the title of the column not on the cell. I've not had any luck finding an example.
import { Component, OnInit, Input, EventEmitter, Output, NgModule } from '@angular/core';
@Component({
selector: 'tooltip-view',
template: `
<button type="button" class="btn btn-outline-secondary" ngbPopover={{TooltipText}} triggers="mouseenter:mouseleave" popoverTitle={{TooltipTitle}}>
{{ value }}
</button>
`,
})
@NgModule()
export class TooltipComponent implements OnInit {
renderValue: string | number;
@Input() value: string | number;
@Input() rowData: any;
@Output() save: EventEmitter<any> = new EventEmitter();
ngOnInit() {
//this.renderValue = this.renderValue.toString().toUpperCase();
}
onClick() {
this.save.emit(this.rowData);
}
}
In the settings colums:
clin: {
title: 'CLIN',
type: 'custom',
filter: false,
renderComponent: TooltipComponent,
onComponentInitFunction(instance) { instance.TooltipText = 'This is the tooltip text for CLIN',
instance.TooltipTitle ='Help for CLIN'; }
},
Would like to move this functionality from a table cell to title, is this possible? Are there an examples of this?