User Input Drop-Down Sort

Hi Shlomi,

I looked at the code and see that the code you gave me displays ‘no results found’ in the developer’s console. Is there a way to have the code set so it displays text or an image on the screen for the viewer when no results are found? I can even make an entry to the database that is displayed when no results are found that is a picture that says ‘no results found’.

Thanks for all your help!
Emma

Emma,

Indeed, the code gets you to a point where no result is found, in which you can code anything you want. I’d go for displaying a text that says that, and hiding it in case there are results, but your choice, just cide it right there :slight_smile:

Shlomi

Hi Team Wix Code, I deployed a code which I copied from Wix Expert Nayeli but I modified it a bit to use a drop-down instead of a search input box.
My question is, how can I link the items in the display box to the database collection? Here’s the code which I used:

import wixData from ‘wix-data’;
$w.onReady(function () {
//TODO: import wixData from ‘wix-data’;
});

export function dropdown1_change() {
wixData.query(‘Matching-Category’)
.contains(‘category’, $w(‘#dropdown1’).value)
.find()
.then(res => {
$w(‘#table1’).rows = res.items;
$w (‘#table1’).show();
});
}

Here’s the reference screenshots:

Hi Shlomi,

I’m sorry, I’m really new to coding. What would I code in to reveal a hidden element?

Emma

Shlomi,

I think I figured it out! Thank you!

I LIKE THIS! :slight_smile: Can I use the code for selecting parts according to one or more selections in drop menus?

I’d like my visitors to be able to find car parts depending on their selections of :

  • year
  • and/or make
  • and/or model
  • and/or part name

Here’s my site to help you understand :

merlinregis.wixsite.com/accueil

Awesome work here from all of you! This is very helpful. Thanks for sharing this in so much detail.

Quick question… I am setting up a similar page (more like the airline example above with the tick boxes) except I would like for user to be to be able to select from categories displayed on landing page which will then direct them to the filtered results page (event listings) with the specific filter results displaying based on the category they chose on the previous page. I havent started on the results/event listings page as of yet until I find the best method, so that I don’t waste time going back and forth.

Any feedback is greatly appreciated!

  • Nelson

Hi Nelson,

you can do that but why separating it into 2 different pages?

Shlomi