Skip to content
Discussion options

You must be logged in to vote

Thank you for the interesting scenario @Anindya088

TL-DR: You do NOT instantiate another ui.context_menu() when you want to change what's in the context menu.

Rather, you must:

  • keep a reference to the context menu (see cmenu in my code),
  • when right click comes, clear stuff out (cmenu.clear()),
  • and put new stuff back in (with cmenu: then blahblahblah...)

I have also applied type like this: e: GenericEventArguments, just so args shows up blue, not white. It's a personal preference thing. Get rid of it if you don't like it.

from nicegui import ui
from nicegui.events import GenericEventArguments

grid = ui.aggrid({
    'columnDefs': [
        {'headerName': 'Name', 'field': 'name'},
        {

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Anindya088
Comment options

Answer selected by Anindya088
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants