Blueprint: New Feature: Dynamically loadable menu options

Created on 6 Mar 2017  路  3Comments  路  Source: palantir/blueprint

The application we are building supports many actions that user can take on a particular record. Some of these actions are discovered at runtime depending on authorization or other features. When we are displaying multiple rows, it is very resource intensive to pre-calculate all available options and render in the beginning.

Instead we would like to calculate the options when user clicks on the menu. To enable these use cases, it would be really helpful if Menu supports dynamic loading of menu options.

It might work something like this.

  1. User clicks on the menu trigger (icon button)
  2. Menu Popup shows up but it has a spinner and triggers onOpen callback
  3. Container will fetch menu options available for that menu and renders with options.
  4. At this time, spinner goes away and menu options are shown

If this is possible with current implementation, can you please hint how to show spinner in menu?

core question

Most helpful comment

You don't show a spinner in a Menu, you show it in the Popover contents _in place of_ the Menu while the menu item data is loading.

All 3 comments

You don't show a spinner in a Menu, you show it in the Popover contents _in place of_ the Menu while the menu item data is loading.

@adidahiya makes sense. Thank you, will try and update this thread.

I could implement lazy loaded menu options using the approach suggested by @adidahiya so I think we are good now. Thanks for the help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ernestofreyreg picture ernestofreyreg  路  3Comments

raiju picture raiju  路  3Comments

tomzaku picture tomzaku  路  3Comments

tgreenwatts picture tgreenwatts  路  3Comments

vinz243 picture vinz243  路  3Comments