Search
Tooltip.show Method
See Also
 






Shows the tooltip.

Namespace: MindFusion.Common.UI
File: Tooltip.js

 Syntax

JavaScript  Copy Code

function show ([position])

 Parameters

position
Optional.

MindFusion.Drawing.Point. The point at which to display the tooltip if its position is set to TooltipPosition.Cursor.

 Example

The following code handles the itemMouseEnter event of a TreeView and shows a tooltip when the mouse is over child nodes:

JavaScript  Copy Code

// This is the handler function of tree.itemMouseEnter event.
// If the node, sending the event is a root node, set some node-dependent data and show the tooltip.
function nodeEnter(sender, args)
{
 var node = args.item;
 if (!node.parentNode)
 {
  tooltip.element.querySelector("#truckNo").innerText = node.title;
  tooltip.element.querySelector("#dest").innerText = node.flatItems.where(function (n) { return n.level == 1 }).count();
  tooltip.element.querySelector("#del").innerText = node.flatItems.where(function (n) { return n.level == 2 }).count();

  tooltip.show(new d.Point(tree.bounds.right() + 10, tree.bounds.y + node.bounds.y - tree.element.scrollTop));
 }
 else
  tooltip.hide();
}

 See Also