Hello everyone, I’m trying to add some search functionality to my site.
I’m adding this code (below) to my site but it’s not working.
Can anyone help me with this?
(you can find screenshots in the end)
this is the code i use:
export function mainSearch_keyPress ( event ) {
// Add your code for this event here:
// Runs a query on the “properties” collection
wixData . query ( “properties” )
// Query the collection for any items whose “title” field contains
// the value the user entered in the input element
. contains ( “title” , $w ( “#mainSearch” ). value )
. find () // Run the query
. then ( res => {
// Set the table data to be the results of the query
$w ( “#resultsTable” ). data = res . items ;
});
}