Jspreadsheet Server Custom Menu

The menu property lets you add, modify or remove top menu options during initialization, to integrate custom features into the interface.

Customizing the Menu

Method Description
menu(object[]) Intercept the top menu options.
server({
    bar: {
        suggestions: true
    },
    client: {
        url: 'http://localhost:3009',
        auth: {
            token: token,
            invitation: invitation,
        },
        onerror: function(e) {
            jSuites.notification(e);
        },
    },
    menu: function(options) {
        // Default options
    }
})

Menu Item Properties

Property Description
title: string Text displayed for the menu item, expandable in wide layouts.
submenu: Item[] Array of sub-items creating a dropdown for related features.
icon: string Material icon keyword to visually represent the item.
type: string Defines item type: "line" for separators or "item" for clickable options.
shortcut: string Keyboard shortcut for quick access.
disabled: boolean Disables the item if set to true.
tooltip: string Tooltip text shown on hover, providing additional context.

Event Hooks

Event Description
onclick Executes on click, ideal for feature-specific actions.
render Customizes item display, allowing for dynamic content.

Top Menu Component

The top menu is built with the LemonadeJS Top Menu.

LemonadeJS Top Menu Component


Examples

Remove the Last Item

server({
    bar: {
        suggestions: true
    },
    client: {
        url: 'http://localhost:3009',
        auth: {
            token: token,
            invitation: invitation,
        },
        onerror: function(e) {
            jSuites.notification(e);
        },
    },
    menu: function(options) {
        // Remove the last option
        options.pop();
    }
})