There's customization that needs to go into the code before you can get it working in your app
Line 4-9: Links to the Page URL
Lines 13-20: Creates a dictionary in the format
{view_id_1: "Name of Menu Item 1",view_id_2: "Name of Menu Item 2", etc.}
Line 35: Same as Line 6 but modified.
Line 38-63: Calls the dropdownMenuItem(recordId,route,linkName) function in line 4 per dropdown menu item in Desktop
Line 72-96: Calls the dropdownMenuItem(recordId,route,linkName) function in line 4 per dropdown menu item in mobile screen sizes for min-width is 152px;
We style the menu buttons to be similar to how the default Knack styling is. We also hide the original menu view if screen size is 770px or larger but hide our custom dropdown menu on smaller screens. This allows for easier navigation on mobile without the dropdowns, but also easier navigation on desktop with the dropdowns.
/****************************************/
/*** Dropdown Menu Buttons Navigation ***/
/****************************************/
/* hide custom menu if on mobile */
@media (max-width: 770px) {
#desktop-menu-list {
display: none;
}
}
/* hide knack menu buttons if on desktop */
@media (min-width: 770px) {
#mobile-menu-list {
display: none;
}
}
/*list, list item, and button stylings*/
#desktop-menu-list {
border-bottom: 0 !important;
}
#desktop-menu-list li {
margin-right: 0.5em;
box-shadow: 0px 2px 4px 0px gray;
}
#desktop-menu-list .kn-button a {
color: #163f6e;
font-size: 1.1em;
border-bottom: 0;
padding-top: 3px;
}
.desktop-dropdown-menu-list .kn-button {
border-radius: 1px;
}
.desktop-dropdown-menu-list li {
border: 0;
margin-right: 0 !important;
}
.desktop-dropdown-menu-list li:hover {
background-color:#ebebeb;
}
/*Mobile list, list item, and button stylings*/
.mobile-details-dropdown-menu ul {
margin-left: .25em;
}
#mobile-menu-list {
list-style-type: none;
margin: 0;
}
#mobile-menu-list li {
margin-top:5px;
}
#mobile-menu-list ul {
list-style-type: none;
}
#mobile-menu-list .kn-button a {
padding: 5px;
text-decoration: none;
}
.mobile-dropdown-menu span {
margin-top: .25em;
color: #163f6e;
}
.mobile-dropdown-menu-list {
margin-top: 1em;
}
.mobile-dropdown-menu-list.active {
display: inherit;
}
Example from the Mobility Services Portal - Operating Authority Form