This is a migrated thread and some comments may be shown as answers.

Hover event and dataitem access

3 Answers 47 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jonatan
Top achievements
Rank 1
Jonatan asked on 17 Dec 2014, 08:04 AM
I have a couple of challenges regarding the Diagram, which I need to address.

1: I need to be able to add a class to any shape that I add to the Diagram. How do I do this?

2: Once the classes are added, I need to add a delegated hover event to the shapes (which should be easy enough with jquery). My challenge in this case is that I need to be able to access the dataItem of the shape which I have added the event to.

Can anyone help me with this?

3 Answers, 1 is accepted

Sort by
0
Jonatan
Top achievements
Rank 1
answered on 17 Dec 2014, 08:34 AM
I am hoping that this will allow me to make Kendo tooltips on the shapes.

But if there is a smarter way to make tooltips on the shapes, can someone tell me about it?
0
Jonatan
Top achievements
Rank 1
answered on 18 Dec 2014, 08:44 AM
It seems that currently you cannot add a Telerik tooltip to the diagram shapes.

But I figured out an alternative.

I used the diagrams Click Event to display a simple floating div at the mouse location on the page. I then make the div fade away when the MouseLeave event is fired.

This will do until a future release allows me to make use of teleriks tooltips =]
0
T. Tsonev
Telerik team
answered on 19 Dec 2014, 10:01 AM
Hello,

The Diagram elements are not guaranteed to be in the DOM. The widget can switch between SVG, Canvas and VML rendering depending on the browser.
This requires the diagram to provide "native" mouseenter / mouseleave events. This is something that we plan to do soon.

Apologies for the caused inconvenience.

Regards,
T. Tsonev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Diagram
Asked by
Jonatan
Top achievements
Rank 1
Answers by
Jonatan
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or