I want to show a tooltip on
some cells in a table, not all, but I won't know which cells until the user actually edits the cell values.
Cells that have a numeric value greater than 1 million get a class assigned to them, say "million". If the cell's value is 900000 it doesn't have that class. If the user edits the cell and changes to the value to 2000000, then the cell gets the .million class on-the-fly.
Also, the tooltip content is not known in advance. Example: the tooltip must display the sum total of all cells that contain a value greater than 1 million. My function iterates the cells and grabs any value greater than 1 million and adds these values up. So I would hope to do this:
.tooltip( {
content: myFunction( ){
// return the total ... }
}
What is the best way to create and display a tooltip that would appear when the user hovers over one of these table cells that qualifies for a tooltip? Can I simply create the tooltip ad hoc and open it in the cell's mouseenter eventhandler, and then close it in the mouseleave eventhandler? Would I attach the tooltip to all table cells but quash it if the cell's value does not meet or exceed 1 million? If that is a valid approach, where and how would I intercept the tooltip and tell it not to show itself?