Set Essential JS 2 Tooltip to the commands

25 Jan 20231 minute to read

The tooltipText property of the Toolbar item is used to set the HTML Tooltip to the commands that can be viewed as hint texts on mouse hover.

Initialize the Tooltip with the Toolbar target. Refer to the following code example:

@(Html.EJS().Toolbar("defaultToolbar")
    .Items(new List<ToolbarItem> {
        new ToolbarItem { Type = ItemType.Button, TooltipText = "Cut", Text = "Cut" },
        new ToolbarItem { Type = ItemType.Button, TooltipText = "Copy", Text = "Copy" },
        new ToolbarItem { Type = ItemType.Button, TooltipText = "Paste", Text = "Paste" },
        new ToolbarItem { Type = ItemType.Button, TooltipText = "Undo", Text = "Undo" },
        new ToolbarItem { Type = ItemType.Button, TooltipText = "Redo", Text = "Redo" }
    })
    .Render()
)
public ActionResult Index()
{
    return View();
}

Output be like the below.

Alt text