Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / Tooltips on a Data Grid Cell

Tooltips on a Data Grid Cell

New Discussion
Scott Grosch
Scott Grosch asked on Feb 12, 2019 7:02 AM

Can somebody show an example of how I would attach an igx-tooltip to individual cells of an igx-grid please, and have that tooltip based on the model that populates the row?

In other words, it can’t be static text, each cell would display a custom message based on the model.

Sign In to post a reply

Replies

  • 0
    [Infragistics]Tacho
    [Infragistics]Tacho answered on Jan 4, 2019 10:59 AM

    Hello Scott,

    Thank you for your question.

    In order to attach an igxTooltip to each cell of the igxGrid by modifying the tooltip's content dynamically, I can suggest you create a single tooltip element in your markup and by templating the cells of the grid, you can mark all the cells as targets for that same tooltip.
    In addition, you can handle the onTooltipShow event for every target (the cell) by updating the context property of the igxTooltip with any data that is relevant to the specific cell. In the below example, we pass the cell itself as a context to the igxTooltip and this way the tooltip has a direct reference to the necessary data.

    
    
    Value of cell: {{tooltipRef.context.value}}
    {{cell.value}}
    ...

    I have attached a sample application that demonstrates the approach from above.

    For more details on using the IgxTooltip and the IgxTooltipTarget directives, you can take a look at the following topic.

    If you have any questions, please let me know.

    6888.gridWithTooltips.zip

    • 0
      AMIT JHA
      AMIT JHA answered on Feb 5, 2019 6:57 AM

      How Can I add static tooltip for header only in igx grid. I tried adding title ="some toolyip" but it does not workk:

      <div class="gridContainer">
      <igx-grid #defectdetails [data]="defectsData" [autoGenerate]="false" [rowSelectable]="true" [width]="width" height="256px"
      columnWidth="120px" (onRowSelectionChange)="OnDefectSelection($event)" (onDataPreLoad)="loadDefectData()"
      (onSortingDone)="OnSortData()" (onFilteringDone)="OnFilterData()" [primaryKey]="'rowid'" [emptyGridMessage]="'No Defects to Display.'" [allowFiltering]="true">

      <igx-column header="Pos X" [field]="'PosX'" dataType="number" [filterable]="true" [sortable]="true" [resizable]="true" title="'some Title'"></igx-column>

      </igx-grid>
      </div>
      </div>

      • 0
        [Infragistics]Tacho
        [Infragistics]Tacho answered on Feb 5, 2019 2:57 PM

        Hello AMIT,

        Thank you for the code-snippet you have provided.

        In order to apply a static tooltip to a column's header, you can use both the IgxTooltip and the title attribute by retemplating the actual header of the column.

        Here is an example of how to use both:

        
        
        
        Name tooltip
        
        {{column.field}}
        
        
        
        
        
        
         
        
        {{column.field}}
        
        
        

        If you have any questions, please let me know.

      • 0
        Mihir Khatri
        Mihir Khatri answered on Feb 11, 2019 4:27 PM

        With this approach as well, tooltips don't show up until user has clicked on any header cell to apply sorting

      • 0
        [Infragistics]Tacho
        [Infragistics]Tacho answered on Feb 12, 2019 7:02 AM

        Hello Mihir,

        Thank you for your feedback.

        I have attached a sample application that demonstrates the use of the IgxTooltip and the title attribute as described in my previous reply and I was unable to reproduce the issue you mentioned.

        Please feel free to modify the sample accordingly, so the issue is reproduced and reattach it here, so we can examine it further.

        If you have any questions, please let us know.

        5710.gridWithTooltips_2800_Modified_2900_.zip

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Scott Grosch
Favorites
0
Replies
5
Created On
Feb 12, 2019
Last Post
7 years ago

Suggested Discussions

Created by

Created on

Feb 12, 2019 7:02 AM

Last activity on

Feb 11, 2026 3:40 PM