Hi,
I’m experiencing a strange issue. I have a page (with user input elements) containing a read/write dataset and its filter is set so that no item is loaded in the dataset. I need to load the dataset in my code.
A relevant part of my code is:
$w.onReady( async function () {
$w(“#dsProfile”).onReady( async () => {
await $w(“#dsProfile”).setFilter(wixData.filter()
.eq(“_id”, currentUserId));
…
});
$w(“#dsProfile”).onBeforeSave( async () => {
console.log(“beforesave”);
…
});
…
});
When the setFilter method is called then the onBeforeSave event is also fired during page load. If I remove the setFilter statement then the onBeforeSave event is not fired.
In which situation could it be possible that the setFilter triggers an onBeforeSave event? I’m probably overlooking something.
Kind regards.