- Home
- Forum
- Angular - EJ 2
- custom tooltip
custom tooltip
3 Replies
SN
Sivamathi Natarajan
Syncfusion Team
November 25, 2019 09:33 AM UTC
Thanks for contacting Syncfusion Support.
We suspect that your requirement is to set custom tooltip on hovering column and row headers. So, based on that we have prepared a sample which is available in below.
Code Example:
|
load(args: any): void {
let tooltip: Tooltip = new Tooltip({
target: 'th.e-columnsheader, td.e-rowsheader',
enableRtl: this.pivotGridObj.enableRtl,
beforeOpen: function (args) {
args.element.classList.add('e-pivottooltipwrap');
},
beforeRender: function (args) {
tooltip.content = '';
if (args.target.classList.contains('e-rowsheader') || args.target.classList.contains('e-columnsheader')) {
tooltip.content = '<div class="e-pivottooltip e-pivottooltip-wrap"><p>' + args.target.innerText + '</p></div>';
}
else {
args.cancel = true;
}
}
});
tooltip.appendTo(this.pivotGridObj.element);
};
|
Meanwhile, we have prepared sample for your reference. Please find the sample in below link.
Please let us know if you have any other queries?
Regards,
Sivamathi Natarajan
SK
Suman Kumar
December 5, 2019 08:37 AM UTC
is this for angular pivot view, it doesn't seem to work ? If yes, where can i put my custom message in it?
SN
Sivamathi Natarajan
Syncfusion Team
December 6, 2019 04:14 AM UTC
Hi Suman,
Your requirement can be achieved by load event. We have provided sample to display the row header and column header value as tooltip value. You can customize your content in tooltip.content parameter. Kindly check the below code example.
Code Example:
|
load(args: any): void {
let tooltip: Tooltip = new Tooltip({
target: 'th.e-columnsheader, td.e-rowsheader',
enableRtl: this.pivotGridObj.enableRtl,
beforeOpen: function (args) {
args.element.classList.add('e-pivottooltipwrap');
},
beforeRender: function (args) {
tooltip.content = '';
if (args.target.classList.contains('e-rowsheader') || args.target.classList.contains('e-columnsheader')) {
tooltip.content = '<div class="e-pivottooltip e-pivottooltip-wrap"><p>' + args.target.innerText + '</p></div>';
@*you can customize the tooltip content here.*@
}
else {
args.cancel = true;
}
}
});
tooltip.appendTo(this.pivotGridObj.element);
}; |
Please let us know if you have concern.
Regards,
Sivamathi.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
SK Suman Kumar
- Nov 22, 2019 04:00 PM UTC
- Dec 6, 2019 04:14 AM UTC