Hi Eitan,
Need help passing data between 2 repeaters.
I have 2 repeaters - search repeater and sale repeaters. Search repeater is loaded using a WIX data query and the sale repeater is an empty repeater.
I am loading the search repeater using WIX data query and then want to select an item from the search repeater and push it to the sale repeater. I know I have to use arrays but I can't figure out how to use the array to push the data from the search repeater to the sale repeater.
Hi CT, All you need to do is: 1. Get the data of the selected item 2. Push it into an array with the copied data 3. Assign that array to the copy repeater For example:
let copiedData = []; $w("#originalRepeater").onItemReady(($item, itemData)=>{ $item("#copyButton").onClick(()=>{ copiedData = [...copiedData, itemData]; $w("#copyRepeater").data = copiedData; }) }) //this assumes another onItemReady has already been set up for the copyRepeater
Hope that helps! Eitan