I’ve had a chance to look at your code and I found a couple of issues.
You have a parsing error on line 41 and you have two dataset onReady calls that are outside of the page onReady function.
I recommend creating separate functions for each of the dataset on Ready calls and then calling each function within the page onReady.
The example below should work for you. You do not have to use the same function names, I just named them after the datasets they interacted with.
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
import wixData from 'wix-data';
//Onderstaande code zorgt ervoor dat BESTEMMINGEN alleen getoond worden als deze beschikbaar zijn in de dataset.
$w.onReady(() => {
dataset4()
dataset1()
dynamicDataset()
});
//Onderstaande code zorgt ervoor dat ITEMS alleen getoond worden als deze beschikbaar zijn in de dataset.
function dataset4() {
$w("#dataset4").onReady(() => {
let count = $w("#dataset4").getTotalCount();
if (count === 0) {
$w("#columnStrip162").collapse();
$w("#columnStrip163").collapse();
$w("#repeater15").collapse();
} else {
$w("#columnStrip162").expand();
$w("#columnStrip163").expand();
$w("#repeater15").expand();
}
});
}
function dataset1() {
$w("#dataset1").onReady(() => {
let count = $w("#dataset1").getTotalCount();
if (count === 0) {
$w("#columnStrip93").collapse();
$w("#columnStrip161").collapse();
$w("#repeater14").collapse();
} else {
$w("#columnStrip93").expand();
$w("#columnStrip161").expand();
$w("#repeater14").expand();
}
});
}
function dynamicDataset() {
$w("#dynamicDataset").onReady(() => {
let description = $w("#dynamicDataset").getCurrentItem().cta; //text is the field you want to get its text
$w("#text426").text = description + ".";
})
}