hello, i have a repeater element connected to data.
the text items inside the repeater changes according to dropdown i have.
lets say i have text item ‘#text1’ connected to data column “channel 1”
now, using dropdown, i want ‘#text1’ to take information from channel 2
$item('#text1').text = ("" + itemData.channel2)
the problem is that i can see the text changes but then it returns to the data connected (not using the code)
It is advisable to use either pure code or pure dataset method to connect data to a repeater. In your case you are mixing both methods and thats the reason why your dataset connected repeater is overriding your code. Have a look at our API reference here . And use pure code method to populate and manage your repeater data.
That’s exactly what’s happening - “connected repeater overrides your code”. You do something in code, but then the connection does what it’s supposed to do and set the repeater to what it’s connected to.
As Nithin points out, you need to choose either connected, or using the the WixData API.
How do I connect item using code only instead of using the editor?
You said you were using code. So, the idea is to just use code and disconnect the Repeater from the datasets.
Thank you! Always thought it has to be connected through the editor