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. Image for the cookie policy date
close icon

Custom tooltip for the header in Vue Grid

Is it possible to have tooltip for a Grid header?  I see where you can do the querycellinfo but that really is not a clean solution when you want to explain what the column header means.  If I am using # as my header text because it needs to be a very small width column it would be very helpful to have a tooptip associated with the #

1 Reply

PS Pavithra Subramaniyam Syncfusion Team May 16, 2019 04:40 AM UTC

Hi William, 

Thanks for contacting Syncfusion support. 

You can render the custom tooltip to the Grid header by using the “headerCellInfo” event. Please refer to the below code example, documentation link and sample link for more information. 

[App.vue] 
<template> 
  <div id="app"> 
    <ejs-grid ref="grid" :dataSource="data" :headerCellInfo="headerCellInfoEvent " height="315px"> 
      <e-columns> 
        <e-column field="OrderID" headerText="Order ID" textAlign="Right" width="90"></e-column> 
        <e-column field="CustomerID" headerText="Customer ID" width="120"></e-column> 
        <e-column field="Freight" headerText="Freight" textAlign="Right" format="C2" width="90"></e-column> 
        <e-column field="ShipName" headerText="Ship Name" width="120"></e-column> 
      </e-columns> 
    </ejs-grid> 
  </div> 
</template> 

<script> 
import Vue from "vue"; 
import { GridPlugin } from "@syncfusion/ej2-vue-grids"; 
import { Tooltip } from "@syncfusion/ej2-popups"; 
import { data } from "./datasource.js"; 
Vue.use(GridPlugin); 

export default {   
  methods: { 
    headerCellInfoEvent: function(args) { 
      new Tooltip( 
        { 
          content: args.cell.column.headerText 
        }, 
        args.node 
      ); 
    } 
 
}; 
</script> 

 

Sample               : https://codesandbox.io/s/ndt0u 

Regards, 
Pavithra S. 


Loader.
Up arrow icon