Closed SohaibAshraf1 closed 2 years ago
Your image
item has template_json
property with full information. Just use it inside onSelect
, like this:
onSelect={async(image, pos) => {
const json = JSON.parse(image.template_json);
store.loadJSON(json);
}}
I'm getting template json and the image's url in response to an api. I supplied the image url to the ImagesGrid's getPreview method. However, in order to use them as a template, I now want to give the template json. But I'm not sure how can i achieve it. Is there any way to pass template json to imagesGrid.
here is the code:
Response of Api: