Dynamic Menu Items
↔️Median JavaScript Bridge
To set the example sidebar navigation menu options run the command below. The
enabledparameter is required to activate the sidebar if it is hidden. Thepersistparameter is used to keep the changes after your app is closed and reloaded.var items = [{ label: "Google", url: "https://google.com", icon: "fas fa-cog" // optional Font Awesome icon }, { label: "Sample Grouping", isGrouping: true, subLinks: [{ label: "Apple", url: "https://apple.com", icon: "fas fa-home" // optional }, { label: "Google", url: "https://google.com", icon: "fas fa-home" //optional }] }, { label: "Sample Javascript", url: "javascript:alert('test')" }]; median.sidebar.setItems({"items":items,"enabled":true, "persist":true});
Updated 3 months ago
Next Steps