Hi. I have an irritating little problem that I think should be easy to solve.
This problem shows up while in Preview mode.
I have created a repeater using data from a query.
The repeater stays hidden until a user selects an item from my page.
Then the repeater appears with the data, based upon the user’s choice.
The problem is, that for several seconds the repeater displays what appears to be
the latest data entered into the database, before finally displaying the results of the query.
If the user no longer wishes to view that repeater, it is hidden. But when they make another choice, from the page, the repeater reappears, but with the old data from the old query, for several seconds, again, before displaying the data from the new query.
Here is a rough approximation of the query I am using.
{
var julday = event.data;
wixData.query("mydataset")
.ge("title", "beginningcriteria"))
.le("title", ("endingcriteria")
.ascending("title")
.find()
.then( (results) =>
{
if (results !=="")
{
let d_item = results.items;
$w('#repeater2').data = d_item;
}
});
$w('#repeater2').show();
}
I tried clearing the data in #repeater2 by using this line
$w(‘#repeater2’).data=null
but that results in an error.
My question is:
How can I get the repeater to display the results of the query, and only the query and not data based on previous queries?