eLabSDK.Page.Navigation
addTopMenu(object)
This SDK1 method is deprecated. Please use eLabSDK2.UI.Navigation.addMainMenuAction() instead.
Adds a navigation element to the top main menu.
Kind: global function
See: eLabSDK2.UI.Navigation.addMainMenuAction for the recommended approach.
| Param | Type | Default | Description |
|---|---|---|---|
| object | object | Configuration object for the menu item. | |
| object.label | string | The text label displayed for the menu item. | |
| object.placeLast | bool | Whether to place the item last (currently ignored, items are always appended). | |
| object.action | function | The callback function to execute when the menu item is clicked. | |
| [object.icon] | string | ''fas fa-cog'' | Optional FontAwesome icon class (e.g., 'fas fa-flask'). |
Example
// SDK1 (deprecated)
var nav = new eLabSDK.Page.Navigation();
nav.addTopMenu({
label: 'Start Custom Function',
placeLast: true,
action: function(){
alert('Thank you for using this custom feature');
}
});
Example
// SDK2 (recommended)
eLabSDK2.UI.Navigation.addMainMenuAction({
id: 'my-custom-action',
label: 'Start Custom Function',
action: function(){
alert('Thank you for using this custom feature');
},
isVisible: function() { return true; },
icon: 'fas fa-cog'
});
© 2023 eLabNext
Updated about 18 hours ago