Opening ui.card() in a ui.table() using .add_slot() #3177
-
QuestionHello guys, I am trying to open a I am aware that the problem is here: @ui.on('click', lambda: 'a[@click="openMedicalCertificateCard()"]', [])
async def handle_click_event():
await open_medical_certificate_card() But i can't manage to make it work. table.add_slot('body-cell-certificado_medico', '''
<q-td :props="props">
<a href="#" @click="openMedicalCertificateCard()">See Certificate</a>
</q-td>
''')
async def open_medical_certificate_card():
with ui.card().classes('w-full').style('animation: fadeUp 0.25s ease-out forwards'):
ui.label('Medical Certificate').classes('text-xl font-bold mb-4')
dialog = ui.dialog()
dialog.open()
@ui.on('click', lambda: 'a[@click="openMedicalCertificateCard()"]', [])
async def handle_click_event():
await open_medical_certificate_card() Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Jun 6, 2024
Replies: 1 comment 1 reply
-
Hi @miccs0, There are two very strange issues with your code:
Here is an example how to handle click events in table slots: #979 (comment) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
miccs0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @miccs0,
There are two very strange issues with your code:
ui.on
is not meant to be used as a decorator. How did you come up with this idea?Here is an example how to handle click events in table slots: #979 (comment)