views:

368

answers:

1

I have a TreeView menu populated from a SiteMapDataSource. The TreeView defaults to all nodes expanded, but the normal client side expand/collapse behaviour for the nodes is not working. I get one Javascript error in my Firebug console, being:

TreeView_ToggleNode is not defined

What could be causing this?

A: 

The TreeView menu is on a page that displayed content pages in an IFrame. The TreeView is bound to a SiteMapDataSource, and for convenience, the developer added a <base> tag to the page, declaring the target of all links on the page to be the IFrame. The TreeView uses javascript links for it's navigation buttons and setting a base target breaks these all.

I solved the problem by selectively setting only the actualy menu links, not the expand and collapse buttons, to have a target of the IFrame, with the following jQuery:

$("#navigation a[class^=menu]").attr("target", "iframe1");
ProfK