Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to assign tooltip on web treeview childnodes

Status
Not open for further replies.

toocute4anangel

Programmer
Sep 11, 2003
3
PH
I'm using XML to generate the web treeview. When the application is run, only the parent nodes (the ones which got the plus and minus icon beside them) have the tooltip. I'd also like to assign a tooltip for each child node. Is there a property or element for me to be able to set this? Hope you can help me out on this problem :eek:( i'm using javascript to create and manipulate the treeview contents (XML string) and behavior. Thanks a lot!



 
The 'tool-tip' is the XHTML
Code:
title
attribute of whatever element your pointer happens to be hovering over. You can create this attribute in your XSL just as you would for any other attribute.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
i actually thought about that!:eek:) but being new to xslt, i really don't know exactly how to go about it... can you help me by citing an example... like how to create the tooltip node in xsl ...

we have this for the node text:
<xsl:attribute name=&quot;Text&quot;><xsl:value-of select=&quot;sname&quot;/></xsl:attribute>

how about for the tooltip? what value should i assign... will it be like an <a href title=&quot;the tooltip text&quot;> or something else? thanks a lot!!! :eek:)

 
Yep, just like that. It's up to you as to what you want the tooltip text to be. The how is fairly easy:[tt]
<xsl:element name=&quot;a&quot;>
<xsl:attribute name=&quot;href&quot;>[ignore][/ignore]</xsl:attribute>
<xsl:attribute name=&quot;title&quot;>Your tooltip text.</xsl:attribute>
Your Link Text
</xsl:element>[/tt]

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
it didn't work :(

did you try doing this to any of your application? i think every attribute works except for the title :( here's a sample of my xslt:

<xsl:template match=&quot;/&quot;>
<TREENODES>
<xsl:for-each select=&quot;NewDataSet/ListAll&quot;> <xsl:element name=&quot;treenode&quot;>
<xsl:attribute name=&quot;Id&quot;><xsl:value-of select=&quot;id&quot;/></xsl:attribute>
<xsl:attribute name=&quot;Text&quot;><xsl:value-of select=&quot;name&quot;/></xsl:attribute>
<xsl:attribute name=&quot;ImageUrl&quot;><xsl:value-of select=&quot;icon&quot;/></xsl:attribute>
<xsl:attribute name=&quot;title&quot;>tooltip text</xsl:attribute> (tooltip text can be a variable, this is just for testing)....
</xsl:element>
</xsl:for-each>
</TREENODES>
</xsl:template>

i'm not using href... we opted to use navigateURL atribute which calls a javascript on click of the node.
 
So does your stylesheet output xhtml or xml? If it outputs xml and you view the output in your browser, it's ie's default stylesheet that will generate the xhtml. Using your xsl to stick title attributes in an xml file won't get you very far at all.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top