Demo: Create Context Menu (asynchronous)

Sometimes the menu items are not known up front, for example because they have to be fetched from the server first. This demo registers the menu with trigger: 'none' and opens it by hand once the items have arrived. The setTimeout below stands in for that server round trip, so the menu appears about a second after you right click.

Two things are worth pointing out:

right click me

Example code

Example HTML