Skip to content

render_table without SQL-Alchemy and Action URLs #268

@Markus-

Description

@Markus-

Hi,

I tried to render a table with row-specific URLs without using a Model.
As I understand the code, the problem is, that if I use a string as URL it is more or less static. When I want to create a dynamic (row specific) url I need to hand over a Model (which I do not have).

I just use a JSON-Object as data and a dict as titles.

    products = requests.get("http://localhost:3000/product").json()
    titles = [('name', 'Product'),('long_name', 'Produkt Lang Name')]

    return render_template('products/index.html', products = products, titles = titles)

Without any action urls the rendering works as expected.

        {{ render_table(products, titles, primary_key='name', show_actions=True, custom_actions=[('Run', 'play-fill', 'modals')]) }}

Any idea how to add something dynamic?

... 'modals/' + row[0] + '/edit'

Thanks
Markus

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions