Skip to content

Use checkbox for boolean columns in Table #846

Closed Answered by falkoschindler
tofusoul asked this question in Q&A
Discussion options

You must be logged in to vote

Have you subscribed to the event you're emitting? I tried it myself and it seems to be working nicely:

columns = [
    {'name': 'name', 'label': 'Name', 'field': 'name'},
    {'name': 'age', 'label': 'Age', 'field': 'age'},
    {'name': 'male', 'label': 'Male'},
]
rows = [
    {'id': 0, 'name': 'Alice', 'age': 18, 'male': False},
    {'id': 1, 'name': 'Bob', 'age': 21, 'male': True},
    {'id': 2, 'name': 'Carol', 'male': False},
]
name_options = ['Alice', 'Bob', 'Carol']

def rename(msg: Dict) -> None:
    for row in rows:
        if row['id'] == msg['args']['id']:
            row['name'] = msg['args']['name']
    ui.notify(f'Table.rows is now: {table.rows}')

def update_male(msg: Dict) -> 

Replies: 1 comment 1 reply

Comment options

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

Answer selected by tofusoul
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