top of page
Mega Search

Mega Search

Filter a repeater using multiple input components.

Intermediate.png

Advanced

14K

Published:

March 22, 2020

Girl Enjoying her Drink

by

Anchor 1
Hire a Developer

Example Description

In this example we demonstrate how to search a list of real-estate properties according to multiple types of components. The results are displayed using a repeater.

To improve performance and UX, we use a debounce timer on the input components.

 

Example Code

Tab 1

.

Tab 2

.

Tab 3

.

This code solution can be complicated.

How We Built It

Collection

We used a collection of real-estate properties which includes all the information that should be displayed in the repeater.


Page Elements

In our site we added the following page elements:

  • Repeater: To display the properties.

  • Search components: radio buttons, dropdown, sliders, checkboxes.


Code

Note: We used the lodash NPM module to simplify our code.


In $w.onReady() we run three functions:

  1. initComps() populates the dropdown with entries from the collection, sets the max price, defines the debounce function and binds it to all user input components.

  2. initRepeater() binds the data to the repeater components.

  3. buildFiltersAndPopulateRepeater() creates the filter logic and sends the data to the repeater.


We also Implemented the debounce timer and store it as a variable called debounceFunction. We call this function on input onChange event.

APIs We Used

Non-code example.

Related Articles

Hire a Developer

Velo solutions are powerful tools, but building them on your own can be challenging. Let an experienced Velo development shop build it for you, so you can keep working on your site or business.

Related Examples

Did this help?

Yes

|

No

Thanks for your feedback!

Search a Database

Search a Database

Let visitors quickly search your site content.

Intermediate.png

Intermediate

Filter With Multiple Options

Filter With Multiple Options

Filter a repeater with multiple options using the Selection Tags element.

Intermediate.png

Intermediate

Custom Store Filters

Custom Store Filters

Filter store products by name and price

Intermediate.png

Intermediate

Anchor 2
bottom of page