I have a gallery connected to a dataset. I’m trying to change the images on the gallery using a dropdown menu. the problem is that I pass the src data of the selected item but the gallery doesn’t show the image. what am I doing wrong?
Update/solution:
after a lot of tries(and headaches) I found out the reason it was not showing the image, and was for two reasons:
1- I was missing the ’ =’ sign between " $w(‘#Gallery’).items " and " [{“src”:srx}] "
2- for some reason having connected the gallery to the dataset was a problem. so I created another gallery(mark to hidden on load) and connected that to the dataset to then extract the items data and pass it to my srx variable to use in the gallery for display. and it works!!
export function dropdown1_change(event, $w) {
const dropselec = event.target.selectedIndex;
let item = $w('#Gallery').items
const srx = item[dropselec].src
$w('#Gallery').items[{"src":srx}]
console.log(srx)
}