Logo

Getting Started

  • Installation
  • What is a Daitum Model?
  • Quickstart

Tutorials

  • Introduction to Modelling
  • Data Stores
  • Data Processors
  • Reports
  • Integration
  • Templates & Versioning
  • Best Practices
  • Excel Processors

API Documentation

  • daitum-model
  • daitum-ui
    • Quickstart
    • Views
      • View Types
      • Supporting Components
        • Data
        • Elements
        • Styles
        • Navigation Items
        • Modal
        • Charts
        • Icons
        • Model Event
        • Context Variable
        • Filter Component
        • Menu Configuration
    • UI Builder
  • daitum-configuration
Daitum
  • daitum-ui
  • Views
  • Menu Configuration
  • View page source

Menu Configuration

Data menu configuration for the Daitum UI framework.

This module provides the MenuConfiguration class, which controls the visibility of standard menu items and lets you build a custom data menu from ordered entries (imports, data sources, reports, dividers, and model events).

Keyword-only arguments:

The add_*_entry methods use a bare * in their signatures to mark every argument after it as keyword-only. Arguments before the * (such as key or event) may be passed positionally, but options like icon, prompt_user, and prompt_text must be passed by name. This keeps call sites self-documenting and prevents options from being passed in the wrong position:

menu.add_import_sheet_entry("jobs", icon=Icon.UPLOAD, prompt_user=True)  # correct
menu.add_import_sheet_entry("jobs", Icon.UPLOAD)                         # TypeError
class MenuConfiguration[source]

Bases: Buildable

Configuration options controlling the visibility of various menu items.

hide_optimisation

Whether to hide the optimisation menu option.

hide_import

Whether to hide the main import menu option.

hide_bulk_import

Whether to hide the bulk-import functionality.

hide_import_into_sheets

Whether to hide the “import into sheets” functionality.

data_menu

Custom data menu entries. When any entries are present, only those entries are displayed in the order they were added, superseding hide_import, hide_bulk_import, and hide_import_into_sheets. Other data source and report visibility conditions still apply.

add_import_sheet_entry(key, *, icon=None, prompt_user=False, prompt_text=None)[source]

Adds an import-into-sheet entry targeting the table identified by key.

Parameters:
  • key (str) – The table ID to import into.

  • icon (Icon | None) – Optional icon to display alongside the entry.

  • prompt_user (bool) – Whether to show a confirmation prompt before importing.

  • prompt_text (str | None) – Text for the confirmation prompt; requires prompt_user=True.

Return type:

None

add_import_entry(*, icon=None, prompt_user=False, prompt_text=None)[source]

Adds a general import entry for the current table.

Parameters:
  • icon (Icon | None) – Optional icon to display alongside the entry.

  • prompt_user (bool) – Whether to show a confirmation prompt before importing.

  • prompt_text (str | None) – Text for the confirmation prompt; requires prompt_user=True.

Raises:

ValueError – If an import entry has already been added.

Return type:

None

add_bulk_import_entry(*, icon=None, prompt_user=False, prompt_text=None)[source]

Adds a bulk import entry.

Parameters:
  • icon (Icon | None) – Optional icon to display alongside the entry.

  • prompt_user (bool) – Whether to show a confirmation prompt before importing.

  • prompt_text (str | None) – Text for the confirmation prompt; requires prompt_user=True.

Raises:

ValueError – If a bulk import entry has already been added.

Return type:

None

add_data_source_entry(key, *, icon=None, prompt_user=False, prompt_text=None)[source]

Adds a data source entry that runs the data source identified by key.

Parameters:
  • key (str) – The data source ID to run.

  • icon (Icon | None) – Optional icon to display alongside the entry.

  • prompt_user (bool) – Whether to show a confirmation prompt before running.

  • prompt_text (str | None) – Text for the confirmation prompt; requires prompt_user=True.

Return type:

None

add_report_entry(key, *, icon=None, prompt_user=False, prompt_text=None)[source]

Adds a report entry that runs the report identified by key.

Parameters:
  • key (str) – The report ID to run.

  • icon (Icon | None) – Optional icon to display alongside the entry.

  • prompt_user (bool) – Whether to show a confirmation prompt before running.

  • prompt_text (str | None) – Text for the confirmation prompt; requires prompt_user=True.

Return type:

None

add_divider_entry()[source]

Adds a visual divider between entries in the data menu.

Return type:

None

add_event_entry(event, label, *, icon=None)[source]

Adds a model event entry that triggers the given event.

Parameters:
  • event (ModelEvent) – The model event to trigger.

  • label (str) – Display text for the menu item.

  • icon (Icon | None) – Optional icon to display alongside the entry.

Return type:

None

Previous Next

© Copyright 2026, Daitum.