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

ToolTip on progammatically generated ImageMap?

1 Answer 9 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
jlj30
Top achievements
Rank 2
jlj30 asked on 04 Jun 2013, 01:50 PM
Hi,

I have examined the ImageMap / RadToolTipManager demo, but my situation is a bit different.
I am using a product that builds diagrams which are then rendered using an ImageMap.
Here is a sample from the page source.  I've only shown a few lines of the map:

<MAP NAME='_mfusion_ctl00_ContentPlaceHolder_DiagramView1_ImageMap_0_0'>
<AREA SHAPE='POLY' COORDS='1385,113,1468,113,1468,113,1473,114,1476,117,1479,120,1480,125,1480,125,1480,125,1480,178,1480,178,1479,182,1476,186,1473,188,1468,189,1468,189,1385,189,1385,189,1381,188,1377,186,1375,182,1374,178,1374,125,1374,125,1375,120,1377,117,1381,114,1385,113'
            TITLE="TASK DESCRIPTION: Ensure that all relevant user info has been checked ROLE DUTIES: " ID="_mfusion_ctl00_ContentPlaceHolder_DiagramView1_ImageMap_0_0_20" href="javascript:document.getElementById('_mfusion_ctl00_ContentPlaceHolder_DiagramView1_ClickedItem').value = '20:-1:-1:-1';__doPostBack('ctl00$ContentPlaceHolder$DiagramView1','_mfusion_ctl00_ContentPlaceHolder_DiagramView1_ClickedItem');">

So my question is, how do I go about iterating through this in much the same fashion as your demo does, for an ImageMap that was not created declaratively?

Thanks for any advice.

Jim

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Jun 2013, 02:34 PM
Hi Jim,


You can still iterate through the areas of the map with JavaScript, just as shown in the demo. It does not matter where the image map is created, it is going to be available for a script that comes after the rendered map. You can use the window.onload event to delay the execution of the code that adds ids for the areas. This will ensure the HTML is loaded, yet it is before the Sys.Application.Init event when the RadToolTips are created. The targets for the tooltip manager can be added when you generate the map.

I am not sure how you generate the maps, but you can also add attributes to the areas, so the onmouseover (or onclick) event calls a JavaScript function that will show a tooltip for it. You can use the RadToolTipManager client-side API for this, and a parameter to this function can be this (the element itself) and a custom value that you need for your own logic).


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ToolTip
Asked by
jlj30
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Share this question
or