There are a lot of similar posts but i cannot get it right. I just started working with WIX, so please be patient with me.
The task is collapse images that got no entry in the dynamic database. I think the Permissions are right. The collapse function generally works, too. I think the database is linked to the default layout image when there is no entry in the chart an the coded request will accept the default image as a not empty item? Does somebody know where I made the logic mistake?
First of all a picture of the Editor, Preview and Life Site. The Preview shows the result I would like to get.
Second the Permissions and the Database.
And the Code.
import wixData from ‘wix-data’ ;
$w.onReady( function () {
//Wait for dataset to finish loading
$w( “#dynamicDataset” ).onReady( function () {
//get the value
let imageValue = $w( “#imageX32” ).src;
//collapse the image box if imageValue is empty
if (imageValue === “” ) {
$w( “#imageX32” ).collapse();
}
});
});
$w.onReady( function () {
//Wait for dataset1 to finish loading
$w( “#dynamicDataset” ).onReady( function () {
//get the value
let imageValue2 = $w( “#imageX33” ).src;
//collapse the image box if imageValue is empty
if (imageValue2 === “” ) {
$w( “#imageX33” ).collapse();
}
});
});
$w.onReady( function () {
//Wait for dataset1 to finish loading
$w( “#dynamicDataset” ).onReady( function () {
//get the value
let textbox1 = $w( “#text90” ).text;
//collapse the image box if imageValue is empty
if (textbox1 === “” ) {
$w( “#text90” ).collapse();
}
});
});
$w.onReady( function () {
//Wait for dataset1 to finish loading
$w( “#dynamicDataset” ).onReady( function () {
//get the value
let textbox2 = $w( “#text91” ).text;
//collapse the image box if imageValue is empty
if (textbox2 === “” ) {
$w( “#text91” ).collapse();
}
});
});
I hope that there somebody out there who can help me to solve my Preview - Live Site Problem. Thanks to everybody
Best Marc