David Meffe
David Meffe

Reputation: 63

Menu error - descendants

I've re-created the Menu from Starter App into another App but... I'm getting the following error.

Cannot read property 'descendants' of undefined at Header.MenuButton.onClick:2:34

AMU client and server Scripts are added CSS was added to global app onClick code added to menu button IsVisible Property added to Menu Fragment

I'm obviously missing a step somewhere... and obviously, it has something to do with descendants! haha

Upvotes: 0

Views: 679

Answers (3)

Jeroen at ihello
Jeroen at ihello

Reputation: 3

First be aware that both Page Fragments for Header and Menu are on your page
Second in the 'Outline' Tab put the Page Fragment Header at top and the Page Fragment Menu under the Header
At the Page Fragment Menu select the options 'lock'and 'hide'
At last with the property editor for the Page go to the Page Fragment 'Menu' and by the option 'Visible' put the folowing code @pageFragments.-Name of your Menu Page Fragment-.properties.IsVisible

Upvotes: 0

David Meffe
David Meffe

Reputation: 63

yes I was missing the Hidden and Locked Menu pagefragment. Everything works now :)

Upvotes: 0

HDN
HDN

Reputation: 53

Look at the Material Gallery template. It implements the menu the way you are trying to duplicate with the AMU scripts and CSS. My guess is you did not add the Menu pageFragment to your main page. On any page you want to display the menu, you should have a Menu pageFragment inserted named Menu1. Hard to tell the problem from the info you posted. Maybe you can post your onClick script?

Upvotes: 1

Related Questions