Display Message When Filtering Is Done

Is there a way to show a message or indicate to a user the filtering is done on a page?

I’m using setFilter to filter a dataset on the page. Sometimes a user action to filter will produce the same items as the previous filtering (this is correct functioning). This would look to the user like the filtering did not happen. So is there a way to let the user know the filter was, in fact, performed.

Hi truthandlies.

Assuming you are calling setFilter upon user interaction, e.g. a button click, you can use the setFilter Promise result as an event of filtering is done.

Example:

export function button1_click(event, $w) {
	$w('#dataset1').setFilter(wixData.filter().eq('id', 3))
		.then(() => {
			console.log('filter set is done');
		});
}

More info at: wix-dataset - Velo API Reference - Wix.com - see Return value section.

Regards,
Genry.