Search results

Set Essential JS 2 Tooltip to the commands in JavaScript Toolbar control

20 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.

To change the tooltipText to ej2-tooltip component:

  • Import the Tooltip module from ej2-popups,and initialize the Tooltip with the Toolbar target. Refer to the following code example:
Copied to clipboard
import { Tooltip } from '@syncfusion/ej2-popups';
import { Toolbar } from '@syncfusion/ej2-navigations';

let toolbar: Toolbar = new Toolbar({
width: 300,
items: [
    { text: "Cut", tooltipText: 'Cut' },
    { text: "Copy", tooltipText: 'Copy' },
    { text: "Paste", tooltipText: 'Paste' },
    { text: "Undo", tooltipText: 'Undo' },
    { text: "Redo", tooltipText: 'Redo' }
let tooltip: Tooltip = new Tooltip({
  target: '#element [title]',
Copied to clipboard
<!DOCTYPE html>
<html lang="en">

    <title>Essential JS 2 Toolbar</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript Toolbar Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <link href="//" rel="stylesheet" />
    <link href="" rel="stylesheet" />
    <script src=""></script>
    <script src="systemjs.config.js"></script>

    <div id='loader'>LOADING....</div>
    <div id='container'>
        <div id="Tooltip"><div id='element'></div></div>
        <div id='result'></div>