Hello brains trust,
I’m trying to figure out how to display a simple “no results found” message when a user searches my database and finds no results.
What’s the best way to go about this?
What code should I use and where would it need to be put?
I’ve copied my code below for reference.
Thanks for your help.
Leigh.
import wixData from “wix-data”;
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
//TODO: write your page related code here…
export function searchbutton_click(event) {
//Add your code for this event here:
// Runs a query on the “tenant” collection
wixData.query(“Tenant_Blacklist”)
// Query the collection for any items whose “Name” field contains
// the value the user entered in the input element
.contains(“tenantFullName”, $w(“#input7”).value)
.find() // Run the query
.then(res => {
// Set the table data to be the results of the query
$w(“#table1”).rows = res.items;
});
}
$w.onReady( function () {
$w(“#table1”).columns = [