Using dijit/TooltipDialog with Table of Contents (TOC) Widget

Discussion created by lcesri on Feb 4, 2014
Latest reply on Feb 4, 2014 by JUihlein-esristaff
I'm trying to use the dijit/TooltipDialog ( to display a message when the user hovers over a certain element in our Table of Contents Widget (

The problem is, the dynamically created elements inside the TOC don't have accessible IDs that I can use to know when the user hovers his/her mouse over a certain one. I'll give you an example. One of the labels in the TOC is named "Zoning", and I would like for the dijit/TooltipDialog to appear when the user hovers over the word "Zoning". Here's what the "Legend" looks like in the HTML after it's been dynamically generated:

<span class="agsjsTOCRootLayerLabel" data-dojo-attach-point="labelNode">Zoning</span>

This is the code I tried implementing:
            ], function (TooltipDialog, popup, on, dom) {
                var myTooltipDialog = new TooltipDialog({
                    id: 'myTooltipDialog',
                    style: "width: 300px;",
                    content: "<p>Disclaimer:",
                    onMouseLeave: function () {

                on(dom.byId('labelNode'), 'mouseover', function () {
                        popup: myTooltipDialog,
                        around: dom.byId('labelNode')

I tried using the "labelNode" attribute, but since it's not an ID, it does not work and the popup doesn't generate. Can anyone point me in the right direction here? Help is much appreciated. Thanks in advance!

By the way, this is all taking place inside Tax Parcel Viewer 10.2.