import { Tooltip } from '@syncfusion/ej2-popups';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html'
})
export class AppComponent implements OnInit {
public data: Object[];
@ViewChild('grid')
public grid: GridComponent;
. . . . .
ngOnInit(): void {
this.data = data.slice(0, 5);
. . . .
}
headerCellInfo(args) {
if ( args.cell.column.field === 'CustomerID') {
const toolcontent = args.cell.column.headerText;
const tooltip: Tooltip = new Tooltip({
content: toolcontent
});
tooltip.appendTo(args.node);
}
}
} |
<div class="control-section">
<ejs-grid id="grid" #grid [dataSource]='data'
[editSettings]='editSettings'
[allowSelection]='true' [selectionSettings]='selectOptions'
allowPaging='true' allowFiltering='true' [filterSettings]="filterOptions" (headerCellInfo)='headerCellInfo($event)'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign="Center"></e-column>
. . . .
</ejs-grid>
</div> |