Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Using another vendor's Tooltip - approach? (Read 3545 times)
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
Using another vendor's Tooltip - approach?
Jun 3rd, 2013 at 2:43pm
Print Post  
Hi,

I am using a Tooltip control from Telerik which supports rich content (HTML) and I'd like to use it on the diagrams created with NetDiagram. 

Telerik has a demo of exactly what I'm looking to do, but it is based on an Image Map that is declared, not built dynamically.

Here's a snippet of what I'd need to do:

Code
Select All
foreach (PolygonHotSpot spot in MapOfEurope.HotSpots)
            {
                //The first argument of add method requires the client Id
                //the example implementation will set the id to be the name of the country itself
                this.RadToolTipManager1.TargetControls.Add(spot.AlternateText, spot.AlternateText, true);
            }
 



Any idea how I would accomplish this with NetDiagram.  Is there some event (perhaps on the DiagramView) that I could leverage?

Thanks in advance for any advice.

Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Using another vendor's Tooltip - approach?
Reply #1 - Jun 3rd, 2013 at 4:27pm
Print Post  
Hi,

If tooltips are associated with HTML elements by ID, you can handle the CreatingAreaElement event to assign ID attributes to the areas:

Code
Select All
<ndiag:DiagramView ID="diagramView" runat="server"
	ClientSideMode="ImageMap"
	OnCreatingAreaElement="OnCreatingArea"
	...
public void OnCreatingArea(object sender, MindFusion.Diagramming.WebForms.CreatingAreaElementEventArgs e)
{
	// assuming Item.Id is set
	e.Attributes["id"] = "area_" + e.Item.Id;
} 



and then add the same area_* values to RadToolTipManager1.TargetControls.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
Re: Using another vendor's Tooltip - approach?
Reply #2 - Jun 3rd, 2013 at 5:23pm
Print Post  
Hi Stoyan,

Thanks for the prompt reply.
Your approach is causing the Telerik constructs to be created - I can see them when I do a View Source.
However, when I hover over a shape, I'm still getting the default tooltip.  Do I have to disable this, so that the Telerik one can fire?

Once again, any advice is much appreciated.

Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Using another vendor's Tooltip - approach?
Reply #3 - Jun 3rd, 2013 at 5:37pm
Print Post  
Hi,

I suppose the Telerik code does not stop browsers from showing standard tooltips, so you might want to disable them in any case. I don't have any idea why Telerik's ones would not show though. You might try disabling any mouse-move/enter/leave event handlers you have on the page to see if they don't interfere with Telerik's handlers somehow.

Stoyan
  
Back to top
 
IP Logged
 
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
Re: Using another vendor's Tooltip - approach?
Reply #4 - Jun 3rd, 2013 at 7:21pm
Print Post  
Hi,

I think there's something else going on here.
I am setting the "id" attribute as suggested, but I don't think that's what I need to use.  There's an "ID" attribute which is different - and what I think I should be using to register with Telerik.

Here's what I see under View Source.  I opted to go with a simple "area_#" approach:

Code
Select All
<AREA SHAPE='POLY' COORDS='1419,174,1434,174,1434,189,1419,189,1419,174'
			TITLE="Click here to open this sub-process" ID="_mfusion_ctl00_ContentPlaceHolder_DiagramView1_ImageMap_0_0_21" href="javascript:document.getElementById('_mfusion_ctl00_ContentPlaceHolder_DiagramView1_ClickedItem').value = '21:-1:-1:-1';__doPostBack('ctl00$ContentPlaceHolder$DiagramView1','_mfusion_ctl00_ContentPlaceHolder_DiagramView1_ClickedItem');" id="area_1"> 



Is there any way that I can access the ID value (mfusion_ctl00...) in the OnCreatingAreaElement event handler?

Thanks

Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Using another vendor's Tooltip - approach?
Reply #5 - Jun 4th, 2013 at 7:12am
Print Post  
Hi,

I think these built-in IDs are generated if you use InteractivityExtender or have some click event handlers. They are encoded from the control's ID, the image map indices and the item's index within diagram.Items:

"_mfusion_" + diagView.ClientId + "_ImageMap_" + col + "_" + row + "_" + item.RuntimeIndex;

If you don't set MaxImageSize, col and row will always be 0.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint