90%
top of page

Add a Title

Add a Title
Published Date
Published Date
Tags
0 Comments
Views
Share Post

Comment

successMessage

errorMessage

Add a Title

Add paragraph text. Click “Edit Text” to update the font, size and more. To change and reuse text themes, go to Site Styles.

Add a Title

No comments yet. Be the first to comment!"

Related Posts

Start Now
Start Now

Add paragraph text. Click “Edit Text” to update the font, size and more. To change and reuse text themes, go to Site Styles.

Add a Title

Start Now
Start Now

Add paragraph text. Click “Edit Text” to update the font, size and more. To change and reuse text themes, go to Site Styles.

Add a Title

Start Now
Start Now

Add paragraph text. Click “Edit Text” to update the font, size and more. To change and reuse text themes, go to Site Styles.

Add a Title

  • Writer: @lan Design
    @lan Design
  • Dec 26, 2023
  • 1 min read

Updated: Oct 7, 2024

Learn to filter repeaters with search inputs in Wix.


Search

import wixData from 'wix-data';

$w('#resetButton').hide();
export function searchButton_click(event) {
    search();

}

function search() {
    wixData.query("Properties")
        .contains("title", $w('#searchInput').value)
        .or(wixData.query("Properties").contains("agentName", $w('#searchInput').value))
        .find()
        .then(results => {
            $w('#propertiesRepeater').data = results.items;

        });
        $w('#searchButton').hide();
        $w('#resetButton').show();
        $w('#resetButton').enable();
}
export function resetButton_click(event) {
    $w('#propertiesDataset').setFilter(wixData.filter());
    $w('#searchInput').value = undefined;
    $w('#searchButton').show();
    $w('#searchButton').enable();
    $w('#resetButton').hide();
}

To ensure that the code works properly, make sure you set the names of your elements to match the code OR change the code to match the names of the elements on your site.


Have Fun!

Comments


bottom of page