Hi all. I feel like I am so close, but I lack the understanding to complete. Please help out. I currently have a dropdown connected via code (below), now I need to use the results of the dropdown to populate a gallery. From the media gallery field not image field (see snap)
For reasons, it needs to be code, not through the editor. $w.onReady(function () { });import wixData from 'wix-data'; //code for dropdown export function dropdown1_change(event) { wixData.query("Property") .contains("title", $w("#dropdown1").value) .find() .then(res => { $w("#gallery1").items = res.items; < is this part correct? }); }
// code to load results into gallery????? < I need this part I have looked at the Items and properties page for the gallery API, I can't understand it. This is literally the first and only piece of code I need for the site and seemingly a question that has come up a million times but with no definitive answer. Please...please.... some code for me to copy and paste. I know there will be 4974587 others who would benefit.
Or at least add an example to the tutorial you have here, but for galleries, not tables or repeaters. https://support.wix.com/en/article/corvid-tutorial-adding-collection-data-search-functionality
Note: I am not using a wix pro gallery.
Dropdown reads titles, error I think because i have no code and/or incorrect code to put results into gallery.
gallery, same as snap shot. I've tried to keep it very simple.. even then I cant quite get it >_<
Seriously, I have looked over 4 billion documents and examples, can I just pay someone for like 5 lines of code?
Try this code
import wixData from'wix-data'; $w.onReady(function () { }); exportfunction dropdown1_change(event) { wixData.query("Property") .eq("title", $w("#dropdown1").value) .find() .then((res)=> { $w("#gallery1").items = res.items; }); }
https://www.wix.com/corvid/reference/wix-data/wixdataquery/eq