Skip to content

Table back/forward button support (hash routing?) #1625

Answered by marek-mihok
epa095 asked this question in Q&A
Discussion options

You must be logged in to vote

If you want to display a non-interactive table of information, use a markdown table with hash routing.

Otherwise for ui.table you can set column cell type to markdown with cell_type=ui.markdown_table_cell_type() property. In markdown you can use hash routing by passing a row cell value in the following format: '[cell text content](#my-hash)'. Then you can use event handlers for showing the information page:

@on('#{hash:str}')
async def print_clicked_cell(q: Q, hash: str):
        q.page['form'] = ui.form_card(box='1 1 -1 10', items=[
            ui.text(f'Information page: {hash}'),
            ui.button(name='back', label='Back'),
        ])
Screen.Recording.2022-09-19.at.01.33.06.mov

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@marek-mihok
Comment options

Answer selected by epa095
Comment options

You must be logged in to vote
0 replies
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