views:

284

answers:

2

I have a lot of dijit.TitlePanes stacked up one after another. I wish to handle the onmouseover and onmouseout events for the tile part of the TitlePane. What is the correct way of doing this?

Will something like :

dojo.connect(titlePane.titleNode, 'onmouseover', function f() {});

work, where titlePane is a reference to some dijit.TitlePane object?

Is there some declarative way of setting up such an event handler using "dojo/mehtod"?

A: 

The only way that I know of connecting events in Dojo is through explicit calls to dojo.connect. In other words, I don't believe that you can pass in event handlers as part of the title pane's constructor. My question to you is, does what you have work?

Justin Johnson
I tried out the titlePane.titleNode and it doesn't work. The inspiration for this idea had come from the mention of ``dijit.TitlePane.titleNode.innerHTML`` in the API documentation. I thought may be ``dijit.TitlePane.titleNode`` can also be used. But it seems to me that I am wrong and certainly I am looking for a proper solution :)
Shailesh Kumar
A: 

Looks like it should work, except connect to titleBarNode.

Also, onmouseenter is better than onmouseover.

Bill Keese