Hello, i have a dropdown selection connected to dataset to get its choices.
its a list of categories changed by year.
$w.onReady(function () {
$w("#categories").onReady( () => {console.log($w('#categories').getCurrentItem().category)}) //"CATEGORY A"
});
export function seasonslide_change(event) { //Choose year
let season = $w('#seasonslide').currentSlide.name
$w("#categories").setFilter(wixData.filter().contains("title", season).eq("pos", 1).isNotEmpty("name"))
$w("#categories").onReady( () => {console.log($w('#categories').getCurrentItem().category)}) // Still "CATEGORY A" when CATEGORY B is expected
}
When i get different season with the seasonslide onChange, the function should filter the dataset with the new year, and get new set of categories, which the first one should be “Category B”, but i still get “Category A” and only when i change it again i’ll get the previous one. its like the filter is not happening yet, but i do use onReady for the dataset.
another problem is that somtimes its updating my dataset and changes it as the dataset is is in Read & Write premissions otherwise the dropdown is disabled.
any ideas?