Back to All

Sidebar menu blank

function median_library_ready() {
	let sidebarItems = [{
		label: "Google",
		url: "",
		icon: "fas fa-cog" 
	alert('library ready called');	// To prove code runs
	window.median.sidebar.setItems({"items": sidebarItems, "enabled": true});

I use the above code based on the sample to try to set the sidebar menu items at runtime. I can see from the alert() that the code runs when page is loaded. But the side-menu is always blank - it shows the app icon, but none of the menu item(s).

The design-time menu list is blank. If I add design-time menu items, they show up fine. But it is like the setItems() call is ignored. Whatever is set for the design time list is always displayed for the menu, with setItems() having no apparent effect at all.

Is there something else I need to do to set the sidebar menu items?