Hello there,
Context: I am trying to create a search page for a list of items. Visitors should be able to filter a table (linked to database) thanks to 3 groups of checkboxes.
I have been searching through the forums and found interesting stuff regarding user input, filters and researches by text field. I tried several codes but nothing worked.
Could someone please give me some guidance?
Thank you!
Hello there,
Thank you for your answer.
For now, nothing much I have to admit.
I have been searching here ( Creating filter buttons ) or here ( Create a search for your database ) but it is not exactly what I am looking for.
Have you already been doing searches with check boxes? Is that possible?
Thank you.
Hello again,
I am trying to create a search bar but I keep on getting this error on the filter function :
“‘setFilter’ is undefined.”
Would you know why?
The code I am using:
import wixData from ‘wix-data’;
// For full API documentation, including code examples, visit http://wix.to/94BuAAs
$w.onReady(function () {
//TODO: import wixData from ‘wix-data’;
});
export function filterButton_onClick(event) {
$w(“#table1”).setFilter(wixData.filter()
.contains(“restaurantname”, $w(“#filterInput”).value));
}
Thank you!
Hi,
There is no setFilter method to Table element only to Dataset Element.
Change it to the dataset’s id
For more information:
Roi