Custom tool tip for Header in React grid component

Is there any feature to create Custom tool tip for Header in React grid component.




3 Replies 1 reply marked as answer

GP Gayathri Palanivel Syncfusion Team August 1, 2023 08:55 AM UTC

Hi Viji,


Greetings from Syncfusion support,


Based on your query, you want to set a custom tooltip for the header in the React Grid component. We have achieved your requirement by using the EJ2 Tooltip.


To display a custom tooltip, you can render the Grid control inside the Tooltip component and set the target as "e-headertext". This will show the tooltip when hovering over the grid column header.


Here's an example of how you can do it:

<TooltipComponent

  ref={(t) => (tooltip = t)}

 target=".e-headertext"

  beforeRender={beforeRender}

  {/* Your Grid component goes here */}

</TooltipComponent>


To change the tooltip content for the grid cell header, use the following code in the `beforeRender` event:


const beforeRender = (args) => {

  // Event triggered before rendering the tooltip on the target element.

  tooltip.content = args.target.innerText;

};


By using this method, you can achieve the custom column header tooltip for your React Grid component.

I have attached the sample for your kind reference.

Sample: https://stackblitz.com/edit/react-hxayfg-jdnb8e?file=index.js


Kindly get back to us, if you any concern.
 

Regards,

Gayathri


Marked as answer

VP Viji Palanisamy August 3, 2023 04:07 AM UTC

Thanks for the solutions. IT works perfect.



SG Suganya Gopinath Syncfusion Team August 3, 2023 05:37 AM UTC

We are glad that the provided solution helped to solve the issue. 


Loader.
Up arrow icon