I am trying to create a Grid with Images that are live-fed from an API response,
Let’s say I am getting 4 images, I place them in a grid and show them.
The user is supposed to select one of them, which will then be used like a selection for further processing. It’s basically part of a form.
How could I achieve that?
Are you using a backend or just the API?
I will be storing it after. So at that stage they are coming from the API directly.
But stored as values, obviously.
Then you gotta make your call to the api via rest api plugin and get urls back, then set them as items in a div/grid and set their source via bind to the url
The issue is how I make them selectable for further processing.
I am playing with the idea of adding a listener that stores the selected img src to a variable and then I can simply use it.
Would that make sense? or is there a more straight forward approach?
I would need to know what you want to do next with them, send it to the backend? Fill some more infos?
Both, they will be used for a checkout process and also stored to the backend.
I’d go for a variable then. Depending on where you want to upload it, it might make sense to also upload it right away before checkout and delete it if not checked out, so you can restore the checkout process later.