Search results

Set Essential JS 2 Tooltip to the commands in ASP.NET MVC Toolbar control

08 Apr 2021 / 1 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:

razor
tooltip.cs
Copied to clipboard
@(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()
)
Copied to clipboard
public ActionResult Index()
{
    return View();
}

Output be like the below.

Alt text