Hello,
How to add a tool tip in a Grid on a column header
Thank you...
tool tip in a grid on a column header
-
- 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:
- 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
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.
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.
- After setting up a grid, I added the following code to the onload event of the screen.
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.
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; }
- I then set the title attribute to the value of the child objects' innerText, which would be the header name.
- When the screen has been saved and compiled, and the program is set to run, I test the header tooltips.
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,
-
- 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
Good very good !!
Thank you...
Thank you...
Who is online
Users browsing this forum: No registered users and 1 guest