Hello friends! So i got a preload box that opens in front of my repeater. THis way when a filter is applyed to the data, this box preload shows up saying it’s loading and hides when it finishes. It’s working, however the box closes way before the repeater really actualises its information. I am guessing my code wait for filter to load on the dataset, and not really on the repeater.
Is it possible to make the preload hide only after --the repeater itself-- is refreshed and all the new info are there?
Here follows the bit of my actual code that I use for preload:
$w("#BTspecN").onClick((event,) => {
$w("#loadingWarning").show(); //Show the warning preloading box on click of the button that also sets the filter on a hidden input field.
$w("#MyDataset").onCurrentIndexChanged(()=>{
$w("#loadingWarning").hide();
})
Raaj thanks for your answer. That was just a bit of the code, because there is a lot going on in the whole thing. Here goes the “full” code:
$w.onReady(function () {
$w("#BTspecN").onClick((event,) => {
$w("#columnStrip15").show();//reveals the column/repeater docs names and info
//preloade bit
$w("#loadingWarning").show();
$w("#profCred").onCurrentIndexChanged(()=>{ //data
$w("#loadingWarning").hide();
})
//actions bit
$w("#secondInput").value = $w("#KEYTEXT").text; //#KEYTEXT value: insert on secret Input
let searchValue = $w('#secondInput').value; //value here
$w("#profCred").setFilter(wixData.filter().contains('especialidades', searchValue)) //filter
});
});
})
I cleaned the code a bit since there are a bunch of other little things going on up and down, but I believe this is what covers the issue with the preloader. As you see I have added a filter, but not a .then since I thought “onCurrentIndexChanged” would already cover that it should go after idataset had updated. Could you please help me understando were and how should I put the .then and if should I erase something from the actual code so it does not conflict?