helloflask / bootstrap-flask

Bootstrap 4 & 5 helper for your Flask projects.
https://bootstrap-flask.readthedocs.io
Other
1.12k stars 190 forks source link

condition when render_table with actions or custom actions ? #226

Closed ningen1 closed 2 years ago

ningen1 commented 2 years ago

Hi,

is it possible to have conditions when using

{{ render_table(table_data, show_actions=True, model=Mymodel, view_url=('contact_link', [('link_id', ':id')]) ) }

to show the action per condition, to have it active or disabled for example ? any ideas how can i achieve that ?

first of all to say - amazing project! <3

edit: Ok i just end up having multiple tables based on condition, also works for me

greyli commented 2 years ago

Thanks for the kind words. You can also pass a boolean variable to the show_actions.