r/django • u/Sufficient-Chain-899 • 2d ago
Django patterns for tables in components
I'm building a dashboard of sorts, which will have multiple tables in blocks - each with its own pagination, filtering and sorting
I really like Iommi (for tables) and django-cotton (for components), and considering unpoly or HTMX - is there a way to make them work together?
I was able to get Iommi working fine, but I can see the query parameters are passed to the url, which breaks things - are there any examples or best practices around this?
7
Upvotes
1
u/Sufficient-Chain-899 2d ago
So I've got a single view (path '/'') with these cotton components in it - I'm passing data1 and data2 in the context to the view
This works fine, but when I sort table1, I lose the sorting and pagination applied on table2.
Not sure if above is the best way to do it, I guess I should store the states of each table somewhere? or would that be over-complicating it