Hello friends, I am using a repeater, how can I hide and make it appear when I execute the "search" button function?
My code is like this:
import wixData from 'wix-data'; $w.onReady(function () { $w("#repeaterjd").onItemReady(($item, itemData, index) => { $item("#text27").text = itemData.ro; $item("#text28").text = itemData.vin; $item("#text29").text = itemData.licensePlate; $item("#text30").text = itemData.year; $item("#text31").text = itemData.make; }) async function search (){ const query = $w("#inputSearch").value; const roQuery = wixData.query("jdfulldata").contains("ro", query); const vinQuery = wixData.query("jdfulldata").contains("vin", query); const lpQuery = wixData.query("jdfulldata").contains("licensePlate", query); const jdQueryResult = await roQuery .or(vinQuery) .or(lpQuery) .find(); const jdfull = jdQueryResult.items; $w("#repeaterjd").data = jdfull; $w("#repeaterjd").expand; } $w("#buttonSearch").onClick(search); let throttle $w("#inputSearch").onInput(()=>{ clearTimeout(throttle); throttle = setTimeout(() => { search(); }, 500); }) });
Hi Catalina,
You can set the repeater as 'hidden' or 'collapsed' by default through the Velo IDE. (Select the element and look under where you change the id). Then you can show or expand the element using $w("#exampleElement").show() or $w("#exampleElement").expand() after your query is complete. Let us know if that helps! Eitan