Hello guys,
i am working on something quite big. I am trying to build a communication platform for small and medium enterprises and if this works out it will be a part of my bachelor thesis.
A part of my site will include some sort of search function, where you can search for a company via different variables (Title, category, city).
I created a query function, in which i use an input box and an event button to query my database. I want the query to react on a repeater and show the fitting results from the database. The repeater is collapsed when the site is loaded so i thought it would be wise to use the “expand”-function.
I saw a similiar code working absolutely fine but mine doesnt even start querying i think.
I share my code with you:
//
import wixData from ‘wix-data’;
export function button2_click(event, $w) {
wixData.query(“buisnessdatabase”)
.eq(“Title”,$w(“#input1”).value)
.or(wixData.query(“buisnessdatabase”) .eq(“city”,$w(“#input1”).value))
.or(wixData.query(“buisnessdatabase”) .eq(“category”,$w(“#input1”).value))
.ascending(“city”)
.limit()
.find()
.then( () =>{
$w(“#repeater1”).expand(“#container1”) ;
} );
}
//
I hope that this makes any sense at all.
I am looking forward to your replies!
Greetings,
Dawd