We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

custom tooltip

Thread ID:

Created:

Updated:

Platform:

Replies:

149357 Nov 22,2019 04:00 PM UTC Dec 6,2019 04:14 AM UTC Angular - EJ 2 3
loading
Tags: PivotView
Suman Kumar
Asked On November 22, 2019 04:00 PM UTC


Sivamathi Natarajan [Syncfusion]
Replied On 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 


Suman Kumar
Replied On 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?

Sivamathi Natarajan [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon