How to handle a list of objects?

Hi!

I just started using Dash, and got stuck at a more advanced usage. I have a list of objects (about 200 of them), that I need to present. Each item is shown through a “card” with relatively complex UI (there are different texts and class names and attributes to be updated). I started by dynamically creating such a card, and replacing the whole bunch when there was a change (which is done automatically at an interval). The problem with that is that if I have UI state (like having clicked on a card to show a context menu), that state is reset when page is updated.

Before I start trying out to create all cards in advance and having like ~10 outputs in the callback for each of them, I’d like to check that it will help with the state problem, and if there are any other issues besides having a callback with ~2000 outputs… Is that even feasible?

I suppose this might be best served by a custom component, but at this moment that feels too advanced for me.

Hello @vladdu,

Welcome to the community!

Have you looked into pattern-matching? This might help in both cases, since you can create one pattern and update all the cards in the layout. :slight_smile: