LarsL
(Lars Langenstueck)
September 15, 2023, 6:47am
1
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?
Broberto
(Rob)
September 15, 2023, 7:55am
2
Are you using a backend or just the API?
LarsL
(Lars Langenstueck)
September 15, 2023, 8:19am
3
I will be storing it after. So at that stage they are coming from the API directly.
But stored as values, obviously.
Broberto
(Rob)
September 15, 2023, 8:34am
4
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
LarsL
(Lars Langenstueck)
September 15, 2023, 8:36am
5
100% agreed.
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?
Broberto
(Rob)
September 15, 2023, 10:14am
6
I would need to know what you want to do next with them, send it to the backend? Fill some more infos?
LarsL
(Lars Langenstueck)
September 15, 2023, 10:16am
7
Both, they will be used for a checkout process and also stored to the backend.
Broberto
(Rob)
September 15, 2023, 10:48am
8
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.