Hello,
I have a repeater with a list of members associated with a dataset.
I put buttons to make an alphabetical index.
I wrote a function that displays the results in the repeater according to the button clicked (button A, button B, etc ...)
Here is the code of the function:
function filtrage(Malettre){
$w("#teamDataset").setFilter( wixData.filter()
.startsWith("title", Malettre)
)
.then( () => {
//console.log("Dataset is now filtered");
})
.catch( (err) => {
console.log(err);
} );
}
I would like to display a message, if there is no result; How do I change my code?
Thank you for your help.
Add the text element to your page. Make it collapsed on load.
function filtrage(Malettre){ $w("#teaxtMessage").collapse(); $w("#teamDataset").setFilter( wixData.filter() .startsWith("title", Malettre) ) .then(() => { const totalCount = $w("#teamDataset").getTotalCount(); if(totalCount < 1){ $w("#teaxtMessage").expand(); } }) .catch(err => console.log(err)); }