I am developing a custom template with some additional features for the user. They will be able to generate new elements for the visualization inside the template. However I am facing some issues.
I am substantially further then I was before, but I would really need help now. I need to save some custom things in the state so it gets perserved when the user works on the template. I have created a variable in the state called "store" which is set programmatically. E.g. whenever a new element is added by the user through a button click. However it doesn't save it in the state or persist it in the live version or preview. The issue I found is that you have to have a respective settings field in order to trigger a save.
I also tried to trigger it with window.parent.document.getElementById('setting-store') but then i get a CORS on the preview. Althoug it works on localhost.
So my questions would be:
Is there a way to perserve the state or the variables inside of it even if there is no setting respectively
What is the hidden setting used for then? It doesn't perserve if even if i create a hidden setting and set its value programatically
How can I disable this behavior without window.postMessage() which I can't use as I am only inside the iframe and can't attach the event listener to the main page.
I am developing a custom template with some additional features for the user. They will be able to generate new elements for the visualization inside the template. However I am facing some issues.
I am substantially further then I was before, but I would really need help now. I need to save some custom things in the state so it gets perserved when the user works on the template. I have created a variable in the state called "store" which is set programmatically. E.g. whenever a new element is added by the user through a button click. However it doesn't save it in the state or persist it in the live version or preview. The issue I found is that you have to have a respective settings field in order to trigger a save. I also tried to trigger it with window.parent.document.getElementById('setting-store') but then i get a CORS on the preview. Althoug it works on localhost.
So my questions would be:
Thanks :D Thanks for help :D