Welcome Guest Search | Active Topics | Sign In | Register

CustomItem in Menu and Mouse Click conflict Options
Jeff Lundgren
Posted: Monday, November 9, 2009 1:08:03 PM
Rank: Advanced Member
Groups: Member

Joined: 8/22/2007
Posts: 30
I've got a menu with a CustomItem. Inside this CustomItem is HTML that has some Anchor tags. When the menu renders, it works great, until you click on an href, and the menu item takes the click and closes the menu, instead of allowing the anchor tag in the CustomItem to handle it.

What am I doing wrong?
eo_support
Posted: Monday, November 9, 2009 1:30:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Try to set the CustomItem's CancelBubble to true and see if it works for you.

Thanks!
Jeff Lundgren
Posted: Monday, November 9, 2009 2:20:12 PM
Rank: Advanced Member
Groups: Member

Joined: 8/22/2007
Posts: 30
Property 'CustomItem' does not have a property named 'CancelBubble'.

How do I set that?
eo_support
Posted: Monday, November 9, 2009 3:22:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Do you use embedded CustomItem? If so you can use something like this:

Code: HTML/ASPX
<eo:MenuItem>
    <CustomItem>
        <div onclick="eo_CancelBubble(event)">
           ...your original custom item contents go here.....
        </div>
    </CustomItem>
</eo:MenuItem>


Thanks!
Jeff Lundgren
Posted: Monday, November 9, 2009 4:43:19 PM
Rank: Advanced Member
Groups: Member

Joined: 8/22/2007
Posts: 30
That doesn't work.

Infact, I changed it to this inside the CustomItem:

<div onclick="alert('hi');">
<a href="http://www.cnn.com">cnn.com</a>
</div>


.. and the alert box never fired.
eo_support
Posted: Monday, November 9, 2009 5:33:05 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Try use onmousedown. The point is you can use a DIV and eo_CancelBubble together to prevent whatever event that is of importance to you from "bubbling up" to the menu.

Thanks
Jeff Lundgren
Posted: Monday, November 9, 2009 5:47:07 PM
Rank: Advanced Member
Groups: Member

Joined: 8/22/2007
Posts: 30
That works! Thanks for your patient and prompt support.
eo_support
Posted: Monday, November 9, 2009 6:30:34 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Glad it works for you. Thanks for the update!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.