tool tip in a grid on a column header

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
svi
Profound User
Posts: 20
Joined: Mon Feb 04, 2019 10:56 am
First Name: stephane
Last Name: villeminot
Company Name: alcyon france
Country: France
Contact:

tool tip in a grid on a column header

Post by svi »

Hello,

How to add a tool tip in a Grid on a column header

Thank you...
User avatar
Megan
Profound Logic Staff Member
Posts: 90
Joined: Mon Sep 11, 2017 12:15 pm
First Name: Megan
Last Name: Bond
Company Name: Profound Logic
Phone: 5623227473
State / Province: California
Zip / Postal Code: 92692
Country: United States
Contact:

Re: tool tip in a grid on a column header

Post by Megan »

Hello Stephane,

It is possible to add tooltips to headers in a variety of ways, but I have added one simple example below to hopefully help get you started.

To add a tooltip to an element, you can use the title DOM attribute or the onmouseover event with another element to act as the tooltip that would be hidden until the onmouseover event, or whichever chose event, triggers. You can learn more about making custom tooltips from our example blog post here, https://blog.profoundlogic.com/profound ... m-tooltips. The following example will use the title DOM attribute to set the tooltip.
  1. After setting up a grid, I added the following code to the onload event of the screen.

    Code: Select all

    var headerCells = getObj("Grid1").getElementsByClassName("header-cell");
    for(var i=0; i<headerCells.length; i++) {
      headerCells[i].title = headerCells[i].firstChild.innerText;
    } 
    What this code does is it gets the grid object and then gets the grid object's children that have the CSS Class Name 'header-cell' and saves them to the an array referenced by headerCells.
  2. I then set the title attribute to the value of the child objects' innerText, which would be the header name.
  3. When the screen has been saved and compiled, and the program is set to run, I test the header tooltips.
    headerTooltip.gif
    headerTooltip.gif (89.81 KiB) Viewed 576 times
    Please note in the gif that only the header row has the tooltips, the rest of the cells do not have a tootip.

    I hope this helps!

    Thanks,
~MEGAN BOND
Technical Support Specialist
support@profoundlogic.com
svi
Profound User
Posts: 20
Joined: Mon Feb 04, 2019 10:56 am
First Name: stephane
Last Name: villeminot
Company Name: alcyon france
Country: France
Contact:

Re: tool tip in a grid on a column header

Post by svi »

Good very good !!

Thank you...
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest