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.

ParamTypeDefaultDescription
objectobjectConfiguration object for the menu item.
object.labelstringThe text label displayed for the menu item.
object.placeLastboolWhether to place the item last (currently ignored, items are always appended).
object.actionfunctionThe 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