I want to pass data from a collection inside my CustomElement. Basically I have a repeater, connected to a dataset. When I click in a repeater Item, i want to pass the Item informations to the customElement and render it by adding it to the dom inside the customElement. (eg. with appendChild). How can I have achieve this? I tried to use attributeChangedCallback but this seems to rerender the customElement and causing the previously added Items to disappear.
I tried:
-
call a Function inside a customElment
-
dispatch a CustomEvent wich will be handled by the Custom Element
-
access wix-data inside the customElement
none of these worked