|
public addDisabled(args: MenuEventArgs) {
args.element.classList.add("e-custom-tooltip"); // to add the custom class for list items, to show the tooltip
}
ngAfterViewInit() {
//Initialize Tooltip component
this.tooltip = new Tooltip({
// default content of tooltip
content: "Loading...",
// set target element to tooltip
target: ".e-custom-tooltip",
// bind beforeRender event
beforeRender: this.onBeforeRender
});
this.tooltip.appendTo("body");
}
//beforeRender event of tooltip
onBeforeRender(args: TooltipEventArgs): void {
this.content = args.target.textContent;
}
|
|
public addDisabled(args: MenuEventArgs) {
args.element.classList.add("e-custom-tooltip"); // to add the custom class for list items, to show the tooltip
}
ngAfterViewInit() {
//Initialize Tooltip component
this.tooltip = new Tooltip({
// default content of tooltip
content: "Loading...",
// set target element to tooltip
target: ".e-custom-tooltip",
// bind beforeRender event
beforeRender: this.onBeforeRender
});
this.tooltip.appendTo("body");
}
public menuItems: MenuItemModel[] = [
{
text: "Cut",
iconCss: "e-cm-icons e-cut",
id: "To remove"
},
{
text: "Copy",
iconCss: "e-cm-icons e-copy",
id: "Duplicate"
},
{
text: "Paste",
iconCss: "e-cm-icons e-paste",
id: "New Item",
items: [
{
text: "Paste Text",
iconCss: "e-cm-icons e-pastetext",
id: "To pastetext"
},
{
text: "Paste Special",
iconCss: "e-cm-icons e-pastespecial",
id: "To paste specialitem"
}
]
},
{
separator: true
},
{
text: "Link",
iconCss: "e-cm-icons e-link",
id: "To connect"
},
{
text: "New Comment",
iconCss: "e-cm-icons e-comment",
id: "Note"
}
];
//beforeRender event of tooltip
onBeforeRender(args: TooltipEventArgs): void {
this.content = args.target.id; // Customize the tooltip content
}
|